Skip to content

Instantly share code, notes, and snippets.

View lucatsf's full-sized avatar
🪲
Working from home

Lucas Torres lucatsf

🪲
Working from home
View GitHub Profile
@lucatsf
lucatsf / object-literal.php
Created January 11, 2022 18:07
How to create a literal object in PHP
<?php
$testArray = array(
(object)array("name" => "John", "age" => function () {
return 30;
}),
(object)array("name" => "Jane", "hobby" => function() {
return "painting";
})
);