3v4l.org

run code in 300+ PHP versions simultaneously
<?php class JavaScriptObject { protected $varName; protected $object; public function setVarName($varName) { $this->varName = $varName; } public function addObject($object) { $this->object = json_encode($object); } public function __toString() { return 'var ' . $this->varName . ' = ' . $this->object . ';'; } } $jo = new JavaScriptObject(); $jo->setVarName('v'); $options = new stdObject; $options->size = 10; $options->enabled = false; $jo->addObject($options); echo $jo;
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Class "stdObject" not found in /in/nntE4:23 Stack trace: #0 {main} thrown in /in/nntE4 on line 23
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
48.2 ms | 401 KiB | 8 Q