3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 簡単なクラスを宣言 class TestClass { public $foo; private $debug = false; public function __construct($foo) { $this->foo = $foo; } public function myDo() { return $this->debug; } public function __destruct() { if($this->debug) { echo "YES!!"; } } } $class = new TestClass('Hello'); //$ser = serialize($class); $ser = serialize("O:9:&quot;TestClass&quot;:2:{s:14:&quot;TestClassfoo&quot;;s:5:&quot;Hello&quot;;s:16:&quot;TestClassdebug&quot;;b:1;}"); $deser = unserialize($ser); if ($deser === FALSE) { echo "error."; } echo $class->foo; print ((true === $class->myDo()) ? 'true' : 'false' ) . PHP_EOL; //echo $class->debug; //echo htmlspecialchars(serialize($deser)); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Hellofalse

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:
58.92 ms | 401 KiB | 8 Q