3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler( function( HH\int $errno, HH\string $errstr ) { printf("ERROR (%d): %s\n ==> ", $errno, $errstr); // ON ERROR RESUME NEXT; return true; } ); class string { } class int { } class float { } class bool { } function test_hh_string(HH\string $foo) { var_dump($foo); } function test_hh_int(HH\int $foo) { var_dump($foo); } function test_hh_float(HH\float $foo) { var_dump($foo); } function test_hh_bool(HH\bool $foo) { var_dump($foo); } function test_string(string $foo) { var_dump($foo); } function test_int(int $foo) { var_dump($foo); } function test_float(float $foo) { var_dump($foo); } function test_bool(bool $foo) { var_dump($foo); } print("--- CORRECT USAGE ---\n"); test_hh_string('123'); test_hh_int(123); test_hh_float(1.23); test_hh_bool(true); test_string(new string()); test_int(new int()); test_float(new float()); test_bool(new bool()); print("--- INCORRECT USAGE ---\n"); test_hh_string(new string()); test_hh_int(new int()); test_hh_float(new float()); test_hh_bool(new bool()); test_string('123'); test_int(123); test_float(1.23); test_bool(true);

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.20.0200.06020.59
5.6.10.0130.07720.59
5.6.00.0030.08320.45
5.5.180.0170.07020.28
5.5.160.0100.08020.18
5.5.150.0130.06020.05
5.5.140.0130.07020.18
5.5.130.0130.05720.15
5.5.120.0130.06320.28
5.5.110.0100.08320.40
5.5.100.0100.07320.13
5.5.90.0070.07720.30
5.5.80.0130.08320.06
5.5.70.0070.09320.01
5.5.60.0070.07720.26
5.5.50.0030.08020.15
5.5.40.0070.04720.28
5.5.30.0070.08020.21
5.5.20.0070.08320.02
5.5.10.0130.06720.04
5.5.00.0070.07020.13
5.4.340.0000.08319.01
5.4.320.0100.07019.02
5.4.310.0000.08019.14
5.4.300.0170.06319.32
5.4.290.0070.07719.02
5.4.280.0100.07019.18
5.4.270.0170.06319.16
5.4.260.0030.08018.98
5.4.250.0100.05319.03
5.4.240.0070.07719.24
5.4.230.0070.05019.13
5.4.220.0170.06718.99
5.4.210.0100.07319.18
5.4.200.0030.07719.01
5.4.190.0070.07019.18
5.4.180.0070.04319.18
5.4.170.0070.05319.13
5.4.160.0030.05319.22
5.4.150.0100.06018.93
5.4.140.0070.07016.58
5.4.130.0070.07316.57
5.4.120.0130.05316.33
5.4.110.0070.07016.72
5.4.100.0030.07716.56
5.4.90.0100.06316.71
5.4.80.0000.07716.64
5.4.70.0030.07316.52
5.4.60.0130.06716.35
5.4.50.0030.07716.55
5.4.40.0070.06016.44
5.4.30.0070.07316.45
5.4.20.0070.05716.45
5.4.10.0100.07016.68
5.4.00.0130.06715.98
5.3.290.0130.05714.71
5.3.280.0070.06714.64
5.3.270.0030.08314.73
5.3.260.0030.08014.76
5.3.250.0100.07314.59
5.3.240.0070.04314.66
5.3.230.0130.06014.76
5.3.220.0030.07314.62
5.3.210.0230.06314.55
5.3.200.0030.04714.63
5.3.190.0100.07314.56
5.3.180.0070.07314.67
5.3.170.0170.06714.68
5.3.160.0030.07714.73
5.3.150.0170.04314.55
5.3.140.0130.07014.62
5.3.130.0030.05714.55
5.3.120.0070.07314.59
5.3.110.0100.06714.57
5.3.100.0030.07714.20
5.3.90.0030.07714.13
5.3.80.0100.06014.07
5.3.70.0100.06714.00
5.3.60.0070.06714.05
5.3.50.0070.07014.11
5.3.40.0030.08014.06
5.3.30.0030.04313.95
5.3.20.0170.04713.68
5.3.10.0100.07013.81
5.3.00.0100.07313.74
5.2.170.0100.05311.56
5.2.160.0030.06711.56
5.2.150.0070.04711.56
5.2.140.0100.05711.56
5.2.130.0070.05311.56
5.2.120.0070.06311.56
5.2.110.0030.06011.56
5.2.100.0070.05311.56
5.2.90.0100.03711.56
5.2.80.0070.05311.56
5.2.70.0000.06711.56
5.2.60.0100.05711.56
5.2.50.0030.05311.56
5.2.40.0200.05311.56
5.2.30.0100.05011.56
5.2.20.0030.06311.56
5.2.10.0030.06311.56
5.2.00.0070.06011.56
5.1.60.0000.06011.56
5.1.50.0170.04311.56
5.1.40.0030.05011.56
5.1.30.0070.05311.56
5.1.20.0000.05711.56
5.1.10.0030.05711.56
5.1.00.0070.04311.56
5.0.50.0000.05011.56
5.0.40.0000.04711.56
5.0.30.0000.06311.56
5.0.20.0030.04311.56
5.0.10.0030.03711.56
5.0.00.0000.06711.56
4.4.90.0070.03011.56
4.4.80.0000.03011.56
4.4.70.0070.03311.56
4.4.60.0100.02711.56
4.4.50.0030.03311.56
4.4.40.0030.04711.56
4.4.30.0030.03311.56
4.4.20.0030.02711.56
4.4.10.0000.03311.56
4.4.00.0030.05311.56
4.3.110.0030.03711.56
4.3.100.0070.03011.56
4.3.90.0000.03011.56
4.3.80.0000.05311.56
4.3.70.0000.03711.56
4.3.60.0030.03311.56
4.3.50.0070.02311.56
4.3.40.0070.04711.56
4.3.30.0000.03711.56
4.3.20.0000.03311.56
4.3.10.0000.03711.56
4.3.00.0000.03011.56

preferences:
144.63 ms | 1394 KiB | 7 Q