3v4l.org

run code in 300+ PHP versions simultaneously
<?php function struct(string $name, array $class) { $class = json_encode($class); define($name, $class); } function create($class) { $object = (array) json_decode($class); //if(function_exists($object['__construct']())) $object['__construct']($object); return $object; } function call(array &$class, string $member, ...$args) { if(!isset($class[$member])) exit($member.' is not a member of the class.'); else { if(!isset($args[0])) call_user_func('$class["'.$member.'"]', $class); else call_user_func($class[$member]($class, $args)); } } struct('myStruct', [ 'foo' => 'Hello World!', 'bar' => function (array &$this) { echo(' Hi!'); } ]); $obj = create(myStruct); call($obj, 'bar');

This is an error 404

There are `0` results


preferences:
176 ms | 1398 KiB | 7 Q