Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
C0D4681462yCongrats @wombat,
May your sleeping habits be destroyed in the coming months.
@hippolyte that's because the first 300 lines, default everything out with rand() instead of accepting arguments.
The real question is, What was the gender before it was reassigned. -
C0D4681462y@nitnip null?
This is php, and given it's a string assignment I would bet it was "" at best. -
nitnip18082y@C0D4 by default properties have no type and default to null. If it was a typed property, PHP won't allow you to access it before it's initialized.
-
hjk10157312y@illuminaughty dude that was just because he wanted to spell it out for you.
$parent->children[] = new Child();
The conductor of the Child class randomly assigns gender. In the woke version gender is a method that returns a fluid gender object with a scale. PHP is flexible that way. -
Wombat105822yI would suggest the Laravel syntax would be more like
$wombat->createDaughter()
Where
function children(): HasMany
{
return $this->hasMany(Child::class);
}
function createDaughter(): void
{
$this->children->create([
'gender' => 'female',
]);
} -
Congratulations.
Vacation pays off (Easter holidays)... I didn't understand why we needed to know that an animal gave birth.
Took a long time for me to figure that out.
Happy parent hood, remember silence is deadly. -
Wombat105822y@IntrusionCM thanks for the kind words. Becoming father for the third time makes things routine. Still it's a whole new experience with two bigger children wanting your attention, too.
-
@Wombat the more the merrier....
:)
Then I hope that everyone gets along nicely and you can enjoy parenthood as much as possible. -
-
Congratulations!
I would have appended instead of assigning a single object to an array but maybe I don’t know that syntax -
Wombat105821y@Wisecrack @AndroidJester @rov3rand0m thank you very much. She's over a month now... Still acting like a baby.
$child = new Child();
$child->gender = 'female';
$wombat->children[] = $child;
random