3v4l.org

run code in 200+ PHP versions simultaneously
<?php function my_callback( &$param ) {} $callback = 'my_callback'; $a = true; $b = array( $a ); $c = array( &$a ); //my_callback( true ); // Fatal error: passing a value when reference is expected. my_callback( $a ); // OK my_callback( ...$b ); // OK my_callback( ...$c ); // OK //$callback( true ); // Fatal error: passing a value when reference is expected. $callback( $a ); // OK $callback( ...$b ); // OK $callback( ...$c ); // OK call_user_func( $callback, true ); // PHP 7.1+: Warning: Parameter 1 to my_callback() expected to be a reference, value given call_user_func( $callback, $a ); // PHP 7.1+: Warning: Parameter 1 to my_callback() expected to be a reference, value given call_user_func( $callback, ...$b ); // PHP 5.6+: Warning: Parameter 1 to my_callback() expected to be a reference, value given call_user_func( $callback, ...$c ); // PHP 7.0+: Warning: Parameter 1 to my_callback() expected to be a reference, value given call_user_func_array( $callback, array( true ) ); // PHP 7.0+: Warning: Parameter 1 to my_callback() expected to be a reference, value given call_user_func_array( $callback, array( $a ) ); // PHP 7.0+: Warning: Parameter 1 to my_callback() expected to be a reference, value given call_user_func_array( $callback, $b ); // PHP 5.6: Warning: Parameter 1 to my_callback() expected to be a reference, value given call_user_func_array( $callback, array( &$a ) ); // OK call_user_func_array( $callback, $c ); // OK
based on 20WRe

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)
7.4.00.0100.00615.10
7.3.70.0150.00414.41
7.3.60.0070.00714.46
7.3.50.0090.00614.32
7.3.40.0000.01414.43
7.3.30.0100.00214.40
7.3.20.0160.00614.29
7.3.10.0110.00714.57
7.3.00.0120.00314.68
7.2.200.0060.01114.61
7.2.190.0030.01014.77
7.2.180.0080.00814.51
7.2.170.0120.00614.47
7.2.160.0110.00414.54
7.2.150.0180.00314.53
7.2.140.0120.00914.45
7.2.130.0070.01114.26
7.2.120.0070.01114.73
7.2.110.0090.01214.43
7.2.100.0170.00314.55
7.2.90.0130.00614.61
7.2.80.0110.00414.38
7.2.70.0110.00914.66
7.2.60.0070.01114.85
7.2.50.0150.00314.41
7.2.40.0170.00814.53
7.2.30.0100.01014.82
7.2.20.0120.01214.48
7.2.10.0140.00314.38
7.2.00.0100.00614.93
7.1.300.0090.00913.42
7.1.290.0040.01513.59
7.1.280.0120.00613.53
7.1.270.0110.00313.65
7.1.260.0090.00613.94
7.1.250.0130.00313.53
7.1.240.0180.00713.84
7.1.230.0260.00313.72
7.1.220.0140.01413.52
7.1.210.0180.00413.43
7.1.200.0140.00713.77
7.1.190.0120.00913.80
7.1.180.0160.00713.85
7.1.170.0540.00613.43
7.1.160.0170.01013.15
7.1.150.0170.01113.75
7.1.140.0200.00414.02
7.1.130.0150.00913.92
7.1.120.0210.00313.84
7.1.110.0230.00313.41
7.1.100.0160.00813.59
7.1.90.0150.00614.02
7.1.80.0210.01013.93
7.1.70.0200.00313.27
7.1.60.0200.00313.94
7.1.50.0200.00313.74
7.1.40.0180.00513.81
7.1.30.0090.01213.60
7.1.20.0100.01014.11
7.1.10.0050.01513.84
7.1.00.0200.00613.75
7.0.330.0150.01213.52
7.0.320.0200.00713.16
7.0.310.0180.00613.43
7.0.300.0120.01113.59
7.0.290.0180.00512.91
7.0.280.0160.00813.30
7.0.270.0200.00313.43
7.0.260.0160.01213.32
7.0.250.0100.01013.11
7.0.240.0190.00413.09
7.0.230.0120.01113.21
7.0.220.0190.00613.00
7.0.210.0170.00713.41
7.0.200.0190.00813.39
7.0.190.0110.01113.28
7.0.180.0150.00413.69
7.0.170.0560.00013.40
7.0.160.0150.00513.62
7.0.150.0190.00313.43
7.0.140.0150.00713.57
7.0.130.0090.00913.46
7.0.120.0110.01113.25
7.0.110.0120.00813.28
7.0.100.0180.00713.59
7.0.90.0150.00713.32
7.0.80.0050.01513.41
7.0.70.0100.01613.26
7.0.60.0050.01013.21
7.0.50.0160.00013.39
7.0.40.0100.01013.73
7.0.30.0160.01013.61
7.0.20.0070.01313.60
7.0.10.0140.01113.63
7.0.00.0140.00913.71
5.6.400.0190.00614.08
5.6.390.0090.01214.29
5.6.380.0120.00914.07
5.6.370.0140.00014.21
5.6.360.0180.00614.17
5.6.350.0130.00814.17
5.6.340.0230.00014.50
5.6.330.0190.00514.11
5.6.320.0140.00914.52
5.6.310.0050.01514.45
5.6.300.0130.00314.31
5.6.290.0090.01214.17
5.6.280.0090.01414.25
5.6.270.0130.00714.43
5.6.260.0060.00614.35
5.6.250.0070.01014.04
5.6.240.0090.00614.06
5.6.230.0090.01414.31
5.6.220.0180.00014.38
5.6.210.0100.01014.14
5.6.200.0140.00214.15
5.6.190.0070.01014.17
5.6.180.0090.00914.02
5.6.170.0120.00914.50
5.6.160.0150.00014.04
5.6.150.0160.00314.22
5.6.140.0100.00514.24
5.6.130.0210.00014.28
5.6.120.0120.00814.30
5.6.110.0090.00913.98
5.6.100.0210.00314.15
5.6.90.0140.00714.18
5.6.80.0150.00614.30
5.6.70.0100.01013.96
5.6.60.0110.00714.10
5.6.50.0130.01014.08
5.6.40.0090.00313.96
5.6.30.0070.00713.89
5.6.20.0040.01214.05
5.6.10.0090.00514.13
5.6.00.0120.00614.05
5.5.380.0050.01013.83
5.5.370.0140.00514.04
5.5.360.0180.00313.79
5.5.350.0110.00514.04
5.5.340.0050.01014.04
5.5.330.0060.00613.99
5.5.320.0080.00814.32
5.5.310.0060.01114.35
5.5.300.0080.00813.74
5.5.290.0070.01113.93
5.5.280.0050.02014.07
5.5.270.0120.00914.02
5.5.260.0210.00314.16
5.5.250.0190.00014.05
5.5.240.0100.00814.00
5.5.230.0120.00413.91
5.5.220.0000.01414.12
5.5.210.0170.00314.07
5.5.200.0110.00414.01
5.5.190.0030.01013.52
5.5.180.0110.00613.55
5.5.170.0130.00314.00
5.5.160.0150.00813.92
5.5.150.0040.01313.86
5.5.140.0140.00014.08
5.5.130.0100.00713.52
5.5.120.0120.00613.88
5.5.110.0110.00714.18
5.5.100.0050.01313.71
5.5.90.0130.00914.06
5.5.80.0140.00513.77
5.5.70.0070.01713.72
5.5.60.0000.01613.80
5.5.50.0120.00413.84
5.5.40.0050.01014.20
5.5.30.0080.00813.76
5.5.20.0040.01813.47
5.5.10.0180.00013.75
5.5.00.0090.00913.71
5.4.450.0150.00411.34
5.4.440.0000.01311.34
5.4.430.0060.00611.34
5.4.420.0080.00411.34
5.4.410.0100.00311.34
5.4.400.0080.00311.34
5.4.390.0050.00511.34
5.4.380.0040.00911.34
5.4.370.0090.00411.34
5.4.360.0080.00811.34
5.4.350.0070.00711.34
5.4.340.0090.00311.34
5.4.330.0090.00511.34
5.4.320.0050.01011.34
5.4.310.0070.00311.34
5.4.300.0080.00811.34
5.4.290.0090.00511.34
5.4.280.0040.00811.34
5.4.270.0100.00211.34
5.4.260.0170.00011.34
5.4.250.0040.00811.34
5.4.240.0150.00011.34
5.4.230.0070.00711.34
5.4.220.0090.00311.34
5.4.210.0130.00011.34
5.4.200.0120.00011.34
5.4.190.0080.00411.34
5.4.180.0040.00711.34
5.4.170.0120.00011.34
5.4.160.0110.00311.34
5.4.150.0090.00911.34
5.4.140.0100.00311.34
5.4.130.0100.00511.34
5.4.120.0140.00311.34
5.4.110.0090.00311.34
5.4.100.0000.01311.34
5.4.90.0130.00011.34
5.4.80.0050.01011.34
5.4.70.0000.01011.34
5.4.60.0080.00511.34
5.4.50.0040.00911.34
5.4.40.0040.00811.34
5.4.30.0070.00711.34
5.4.20.0050.00511.34
5.4.10.0050.00511.34
5.4.00.0070.00711.34
5.3.290.0080.00411.34
5.3.280.0050.00511.34
5.3.270.0050.00511.34
5.3.260.0110.00711.34
5.3.250.0000.01111.34
5.3.240.0060.00611.34
5.3.230.0050.00511.34
5.3.220.0100.01011.34
5.3.210.0070.00711.34
5.3.200.0030.00711.34
5.3.190.0090.00611.34
5.3.180.0060.00611.34
5.3.170.0110.00411.34
5.3.160.0070.00311.34
5.3.150.0040.00711.34
5.3.140.0090.00511.34
5.3.130.0110.00011.34
5.3.120.0060.00611.34
5.3.110.0090.00311.34
5.3.100.0090.00311.34
5.3.90.0100.00011.34
5.3.80.0140.00011.34
5.3.70.0040.00811.34
5.3.60.0080.00311.34
5.3.50.0090.00611.34
5.3.40.0000.00911.34
5.3.30.0000.01011.34
5.3.20.0090.00511.34
5.3.10.0070.00211.34
5.3.00.0050.00211.34
5.2.170.0110.00011.34
5.2.160.0040.00411.34
5.2.150.0090.00411.34
5.2.140.0070.00311.34
5.2.130.0030.01011.34
5.2.120.0050.00511.34
5.2.110.0000.00811.34
5.2.100.0000.01111.34
5.2.90.0090.00011.34
5.2.80.0090.00311.34
5.2.70.0070.00211.34
5.2.60.0040.00711.34
5.2.50.0100.00011.34
5.2.40.0060.00611.34
5.2.30.0080.00011.34
5.2.20.0030.00511.34
5.2.10.0000.00711.34
5.2.00.0080.00511.34
5.1.60.0100.00011.34
5.1.50.0000.00911.34
5.1.40.0030.00311.34
5.1.30.0110.00311.34
5.1.20.0080.00011.34
5.1.10.0040.00411.34
5.1.00.0080.00011.34
5.0.50.0030.00311.34
5.0.40.0040.00411.34
5.0.30.0000.00711.34
5.0.20.0040.00411.34
5.0.10.0030.00311.34
5.0.00.0080.00011.34
4.4.90.0000.00711.34
4.4.80.0040.00011.34
4.4.70.0030.00311.34
4.4.60.0050.00011.34
4.4.50.0030.00311.34
4.4.40.0020.00211.34
4.4.30.0040.00311.34
4.4.20.0030.00311.34
4.4.10.0000.00611.34
4.4.00.0030.00311.34
4.3.110.0060.00011.34
4.3.100.0000.00511.34
4.3.90.0050.00011.34
4.3.80.0020.00211.34
4.3.70.0000.00411.34
4.3.60.0000.00611.34
4.3.50.0000.00811.34
4.3.40.0090.00011.34
4.3.30.0050.00011.34
4.3.20.0070.00011.34
4.3.10.0000.00811.34
4.3.00.0040.00011.34