3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Kitchen { private $yummy = 'cake'; function __destruct() { if ($this->yummy == 'aaaa') echo 'win!'; } } $obj = new Kitchen(); $refObject = new ReflectionObject( $obj ); $refProperty = $refObject->getProperty( 'yummy' ); $refProperty->setAccessible( true ); $refProperty->setValue($refProperty, 'aaaa'); //var_dump($refProperty); //var_dump($refProperty); unserialize(serialize($refProperty));
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Creation of dynamic property ReflectionProperty::$yummy is deprecated in /in/BCFVV on line 13 Fatal error: Uncaught Exception: Serialization of 'ReflectionProperty' is not allowed in /in/BCFVV:17 Stack trace: #0 /in/BCFVV(17): serialize(Object(ReflectionProperty)) #1 {main} thrown in /in/BCFVV on line 17
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:
47.64 ms | 401 KiB | 8 Q