3v4l.org

run code in 300+ PHP versions simultaneously
<?php class UserDefinedClass{} class DynamicObject{} $ud_obj = new UserDefinedClass(); $do_obj = new DynamicObject(); $sc_obj = new stdClass(); $a_obj = (object)array(); echo "===[get_class()]===\n"; printf( "UserDefinedClass Object Class: %s\n", get_class($ud_obj)); printf( "DynamicObject Object Class: %s\n", get_class($do_obj)); printf( "StdClass Object Class: %s\n", get_class($sc_obj)); printf( "Array-derived Object Class: %s\n", get_class($a_obj)); echo "\n===[gettype()]===\n"; printf( "UserDefinedClass Object Type: %s\n", gettype($ud_obj)); printf( "DynamicObject Object Type: %s\n", gettype($do_obj)); printf( "StdClass Object Type: %s\n", gettype($sc_obj)); printf( "Array-derived Object Type: %s\n", gettype($a_obj)); echo "\n===[is_a(stdClass::class)]===\n"; printf( "UserDefinedClass Object Type: %s\n", is_a($ud_obj,stdClass::class)); printf( "DynamicObject Object Type: %s\n", is_a($do_obj,stdClass::class)); printf( "StdClass Object Type: %s\n", is_a($sc_obj,stdClass::class)); printf( "Array-derived Object Type: %s\n", is_a($a_obj,stdClass::class)); echo "\n===[instanceof stdClass]===\n"; printf( "UserDefinedClass Object Type: %s\n", $ud_obj instanceof stdClass); printf( "DynamicObject Object Type: %s\n", $do_obj instanceof stdClass); printf( "StdClass Object Type: %s\n", $sc_obj instanceof stdClass); printf( "Array-derived Object Type: %s\n", $a_obj instanceof stdClass); echo "\n===[is_a(DynamicObject::class)]===\n"; printf( "UserDefinedClass Object Type: %s\n", is_a($ud_obj,DynamicObject::class)); printf( "DynamicObject Object Type: %s\n", is_a($do_obj,DynamicObject::class)); printf( "DynamicObject Object Type: %s\n", is_a($sc_obj,DynamicObject::class)); printf( "Array-derived Object Type: %s\n", is_a($a_obj,DynamicObject::class)); echo "\n===[instanceof DynamicObject]===\n"; printf( "UserDefinedClass Object Type: %s\n", $ud_obj instanceof DynamicObject); printf( "DynamicObject Object Type: %s\n", $do_obj instanceof DynamicObject); printf( "DynamicObject Object Type: %s\n", $sc_obj instanceof DynamicObject); printf( "Array-derived Object Type: %s\n", $a_obj instanceof DynamicObject); echo "\n===[is_subclass_of(stdClass::class)]===\n"; printf( "UserDefinedClass Object Type: %s\n", is_subclass_of($ud_obj,stdClass::class)); printf( "DynamicObject Object Type: %s\n", is_subclass_of($do_obj,stdClass::class)); printf( "StdClass Object Type: %s\n", is_subclass_of($sc_obj,stdClass::class)); printf( "Array-derived Object Type: %s\n", is_subclass_of($a_obj,stdClass::class));
Output for git.master_jit, git.master, rfc.property-hooks
===[get_class()]=== UserDefinedClass Object Class: UserDefinedClass DynamicObject Object Class: DynamicObject StdClass Object Class: stdClass Array-derived Object Class: stdClass ===[gettype()]=== UserDefinedClass Object Type: object DynamicObject Object Type: object StdClass Object Type: object Array-derived Object Type: object ===[is_a(stdClass::class)]=== UserDefinedClass Object Type: DynamicObject Object Type: StdClass Object Type: 1 Array-derived Object Type: 1 ===[instanceof stdClass]=== UserDefinedClass Object Type: DynamicObject Object Type: StdClass Object Type: 1 Array-derived Object Type: 1 ===[is_a(DynamicObject::class)]=== UserDefinedClass Object Type: DynamicObject Object Type: 1 DynamicObject Object Type: Array-derived Object Type: ===[instanceof DynamicObject]=== UserDefinedClass Object Type: DynamicObject Object Type: 1 DynamicObject Object Type: Array-derived Object Type: ===[is_subclass_of(stdClass::class)]=== UserDefinedClass Object Type: DynamicObject Object Type: StdClass Object Type: Array-derived Object Type:

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.88 ms | 408 KiB | 5 Q