3v4l.org

run code in 300+ PHP versions simultaneously
<?php define( 'APPLY_PATCH', false ); define( 'VERBOSE', true ); class Dummy { public $pub = 0; protected $prot = 1; private $priv = 2; } $dummy = new Dummy(); $dummy_to_arr = (array) $dummy; // Doing this adds NUL bytes to private and protected property keys. $dummy_arr_to_obj = (object) $dummy_to_arr; // Now there's NUL bytes in the property names. $object_vars = APPLY_PATCH ? wp_get_object_vars( $dummy_arr_to_obj ) : get_object_vars( $dummy_arr_to_obj ); if ( VERBOSE ) { echo '$dummy: ', PHP_EOL, var_export( $dummy, true ), PHP_EOL, PHP_EOL; echo '$dummy_to_arr: ', PHP_EOL, var_export( $dummy_to_arr, true ), PHP_EOL, PHP_EOL; echo '$dummy_arr_to_obj: ', PHP_EOL, var_export( $dummy_arr_to_obj, true ), PHP_EOL, PHP_EOL; echo '$object_vars: ', PHP_EOL, var_export( $object_vars, true ), PHP_EOL, PHP_EOL; } foreach ( $object_vars as $property_name => $property_value ) { $dummy_arr_to_obj->$property_name = '1'; } // The new function in PR 3607. function wp_get_object_vars( $obj ) { return array_filter( get_object_vars( $obj ), function ( $key ) { return ord( $key ) !== 0; }, ARRAY_FILTER_USE_KEY ); }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.130.0050.00316.82
8.3.120.0130.00320.90
8.3.110.0110.00016.85
8.3.100.0090.00616.54
8.3.90.0060.00926.77
8.3.80.0060.00317.97
8.3.70.0120.00318.68
8.3.60.0150.00017.00
8.3.50.0000.01516.60
8.3.40.0070.00720.04
8.3.30.0120.00419.09
8.3.20.0060.00924.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.250.0040.00418.54
8.2.240.0140.00417.46
8.2.230.0030.00620.94
8.2.220.0030.00624.06
8.2.210.0060.00326.77
8.2.200.0040.00416.88
8.2.190.0070.00716.68
8.2.180.0130.01016.63
8.2.170.0070.01322.96
8.2.160.0040.01122.96
8.2.150.0070.00025.66
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0030.00519.49
8.2.110.0030.00620.97
8.2.100.0060.00617.84
8.2.90.0000.00720.59
8.2.80.0000.00820.50
8.2.70.0110.00979.33
8.2.60.0130.00779.33
8.2.50.0140.00579.33
8.2.40.0120.00479.33
8.2.30.0160.00379.33
8.2.20.0130.00579.33
8.2.10.0100.00879.33
8.2.00.0180.00179.33
8.1.300.0090.00918.65
8.1.290.0030.00730.84
8.1.280.0100.01025.92
8.1.270.0080.00024.66
8.1.260.0060.00326.35
8.1.250.0030.00628.09
8.1.240.0120.00422.02
8.1.230.0060.00620.80
8.1.220.0000.00817.74
8.1.210.0000.00918.96
8.1.200.0090.00879.33
8.1.190.0140.00479.33
8.1.180.0140.00379.33
8.1.170.0110.00679.33
8.1.160.0150.00279.33
8.1.150.0120.00579.33
8.1.140.0150.00179.33
8.1.130.0080.00879.33
8.1.120.0110.00679.33
8.1.110.0120.00579.33
8.1.100.0130.00479.33
8.1.90.0110.00679.33
8.1.80.0090.00879.33
8.1.70.0090.00779.33
8.1.60.0110.00779.33
8.1.50.0140.00379.33
8.1.40.0110.00779.33
8.1.30.0160.00479.33
8.1.20.0120.00679.33
8.1.10.0150.00479.33
8.1.00.0130.00679.33
8.0.300.0000.00820.16
8.0.290.0080.00879.33
8.0.280.0100.00779.33
8.0.270.0140.00379.33
8.0.260.0080.00979.33
8.0.250.0120.00479.33
8.0.240.0110.00679.33
8.0.230.0170.00179.33
8.0.220.0100.00679.33
8.0.210.0130.00479.33
8.0.200.0120.00579.33
8.0.190.0130.00479.33
8.0.180.0120.00479.33
8.0.170.0140.00379.33
8.0.160.0110.00579.33
8.0.150.0120.00579.33
8.0.140.0130.00479.33
8.0.130.0090.00879.33
8.0.120.0120.00479.33
8.0.110.0100.00779.33
8.0.100.0110.00579.33
8.0.90.0120.00479.33
8.0.80.0130.00479.33
8.0.70.0140.00379.33
8.0.60.0130.00479.33
8.0.50.0120.00579.33
8.0.30.0080.01079.33
8.0.20.0120.00579.33
8.0.10.0130.00579.33

preferences:
46.02 ms | 403 KiB | 5 Q