3v4l.org

run code in 300+ PHP versions simultaneously
<?php class String { public $length = 5; } // Create an instance of the ReflectionProperty class $prop = new ReflectionProperty('String', 'length'); // Print out basic information printf( "===> The%s%s%s%s property '%s' (which was %s)\n" . " having the modifiers %s\n", $prop->isPublic() ? ' public' : '', $prop->isPrivate() ? ' private' : '', $prop->isProtected() ? ' protected' : '', $prop->isStatic() ? ' static' : '', $prop->getName(), $prop->isDefault() ? 'declared at compile-time' : 'created at run-time', var_export(Reflection::getModifierNames($prop->getModifiers()), 1) ); // Create an instance of String $obj= new String(); // Get current value printf("---> Value is: "); var_dump($prop->getValue($obj)); // Change value $prop->setValue($obj, 10); printf("---> Setting value to 10, new value is: "); var_dump($prop->getValue($obj)); // Dump object var_dump($obj);

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)
5.6.280.0030.07321.05
5.6.210.0070.08020.45
5.6.200.0070.08018.19
5.6.190.0130.04020.57
5.6.180.0430.06020.33
5.6.170.0170.04720.62
5.6.160.0070.04320.55
5.6.150.0030.08318.23
5.6.140.0170.07318.24
5.6.130.0030.04018.18
5.6.120.0030.04020.91
5.6.110.0100.08720.98
5.6.100.0070.07320.98
5.6.90.0000.04321.03
5.6.80.0100.08020.36
5.5.350.0300.07320.39
5.5.340.0030.04317.96
5.5.330.0030.05720.42
5.5.320.0100.08320.30
5.5.310.0300.05720.19
5.5.300.0070.03718.08
5.5.290.0070.03718.08
5.5.280.0100.06720.70
5.5.270.0130.06320.65
5.5.260.0030.07020.87
5.5.250.0230.05720.62
5.5.240.0030.06020.13
5.4.450.0000.08319.18
5.4.440.0070.07719.64
5.4.430.0030.08019.63
5.4.420.0030.05719.27
5.4.410.0070.07319.42
5.4.400.0100.04719.00
5.4.390.0000.08018.98
5.4.380.0000.05719.09
5.4.370.0000.08319.09
5.4.360.0100.04019.31
5.4.350.0030.05718.82
5.4.340.0030.04718.98
5.4.320.0030.04719.25
5.4.310.0130.06718.99
5.4.300.0030.06719.17
5.4.290.0000.06019.14
5.4.280.0030.06018.94
5.4.270.0030.03718.94
5.4.260.0030.04319.24
5.4.250.0000.07319.13
5.4.240.0170.06719.08
5.4.230.0030.07319.08
5.4.220.0100.07019.08
5.4.210.0030.04318.84
5.4.200.0000.07319.14
5.4.190.0000.07019.14
5.4.180.0130.03719.15
5.4.170.0100.03319.18
5.4.160.0000.05018.97
5.4.150.0070.06719.17
5.4.140.0030.04716.38
5.4.130.0030.07016.39
5.4.120.0030.05016.35
5.4.110.0030.06016.27
5.4.100.0100.06716.27
5.4.90.0000.07016.29
5.4.80.0000.07716.44
5.4.70.0030.03716.25
5.4.60.0070.06716.35
5.4.50.0000.04716.26
5.4.40.0030.05316.41
5.4.30.0100.04716.55
5.4.20.0000.03716.53
5.4.10.0000.05716.43
5.4.00.0030.06715.76
5.3.290.0030.08314.81
5.3.280.0070.06314.81
5.3.270.0000.08314.81
5.3.260.0030.07014.81
5.3.250.0000.05314.81
5.3.240.0000.06314.81
5.3.230.0070.07014.81
5.3.220.0070.06014.81
5.3.210.0030.06014.81
5.3.200.0030.04714.81
5.3.190.0070.06014.81
5.3.180.0030.04014.81
5.3.170.0030.07314.81
5.3.160.0030.07714.81
5.3.150.0000.08014.81
5.3.140.0070.05714.81
5.3.130.0130.06714.81
5.3.120.0070.03714.81
5.3.110.0000.06314.81
5.3.100.0070.07014.81
5.3.90.0030.04714.81
5.3.80.0070.05314.81
5.3.70.0000.08014.81
5.3.60.0030.07014.81
5.3.50.0000.05714.81
5.3.40.0000.07014.81
5.3.30.0000.04014.81
5.3.20.0030.03714.81
5.3.10.0030.05714.81
5.3.00.0000.04314.81
5.2.170.0100.03314.81
5.2.160.0000.06014.81
5.2.150.0200.04014.81
5.2.140.0030.03014.81
5.2.130.0000.03014.81
5.2.120.0030.03714.81
5.2.110.0030.04314.81
5.2.100.0030.04014.81
5.2.90.0000.05014.81
5.2.80.0100.04314.81
5.2.70.0000.05014.81
5.2.60.0000.04014.81
5.2.50.0000.03714.81
5.2.40.0030.05014.81
5.2.30.0000.04014.81
5.2.20.0000.06314.81
5.2.10.0000.05714.81
5.2.00.0100.03714.81
5.1.60.0100.04014.81
5.1.50.0000.05014.81
5.1.40.0000.05314.81
5.1.30.0030.05314.81
5.1.20.0000.05714.81
5.1.10.0030.04014.81
5.1.00.0070.03714.81
5.0.50.0030.04314.81
5.0.40.0030.02714.81
5.0.30.0000.04314.81
5.0.20.0000.03714.81
5.0.10.0000.04014.81
5.0.00.0030.04014.81
4.4.90.0000.02314.81
4.4.80.0000.02014.81
4.4.70.0000.02014.81
4.4.60.0000.03014.81
4.4.50.0030.03314.81
4.4.40.0000.04014.81
4.4.30.0070.02014.81
4.4.20.0000.03714.81
4.4.10.0000.03714.81
4.4.00.0000.04314.81
4.3.110.0000.02714.81
4.3.100.0000.02314.81
4.3.90.0100.02014.81
4.3.80.0070.02714.81
4.3.70.0130.01314.81
4.3.60.0070.01714.81
4.3.50.0070.02014.81
4.3.40.0000.04014.81
4.3.30.0000.03714.81
4.3.20.0030.02314.81
4.3.10.0000.02314.81
4.3.00.0000.02314.81

preferences:
139.64 ms | 1394 KiB | 7 Q