3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class x { public $a = [ '~.~e' => '$this->waa($0);' ]; function p($s) { foreach($this->a as $p => $r) { // support deprecated PREG_REPLACE_EVAL if (preg_match('~^(.*)([/\~])([imsxADSUXJu]*)e([imsxADSUXJu]*)$~s', $p, $m)) { $s = preg_replace_callback($m[1].$m[2].$m[3].$m[4], function($m) use ($s, $r){ return eval('return '. preg_replace_callback('~\$(\d)~', function($i) use($m){ return $m[ $i[1] ];}, $r).';'); }, $s); } else $string = preg_replace($p, $r, $s); } return $s; } function waa($t){ return '*'.$t.'*'; } } var_dump((new x)->p('wazup'));
based on t6ec6

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.3.10.0090.00616.57
7.3.00.0060.01016.83
7.2.130.0000.01016.79
7.2.120.0030.00816.96
7.2.110.0030.01416.86
7.2.100.0070.01117.18
7.2.90.0070.01017.01
7.2.80.0030.01117.10
7.2.70.0040.01117.23
7.2.60.0030.01417.14
7.2.50.0060.00917.12
7.2.40.0030.00716.94
7.2.30.0130.00016.86
7.2.20.0130.00617.23
7.2.10.0040.00817.05
7.2.00.0020.01018.44
7.1.250.0040.00816.14
7.1.240.0120.00015.79
7.1.230.0030.01015.82
7.1.220.0000.00815.79
7.1.210.0030.00616.11
7.1.200.0050.01115.98
7.1.190.0000.00916.16
7.1.180.0000.01515.95
7.1.170.0090.00315.88
7.1.160.0040.00716.05
7.1.150.0000.00915.69
7.1.140.0040.01216.05
7.1.130.0120.00015.71
7.1.120.0070.01015.94
7.1.110.0060.00615.67
7.1.100.0040.00617.23
7.1.90.0030.01015.92
7.1.80.0040.00815.83
7.1.70.0020.01216.65
7.1.60.0100.00817.70
7.1.50.0080.00816.55
7.1.40.0120.00415.85
7.1.30.0120.00315.84
7.1.20.0090.00615.69
7.1.10.0000.00915.80
7.1.00.0020.04519.30
7.0.330.0000.01015.72
7.0.320.0060.00915.52
7.0.310.0000.01115.60
7.0.300.0030.01215.47
7.0.290.0000.01715.34
7.0.280.0040.01115.68
7.0.270.0000.01115.56
7.0.260.0070.00415.78
7.0.250.0060.00615.39
7.0.240.0120.00315.70
7.0.230.0070.00315.28
7.0.220.0040.00715.02
7.0.210.0000.01315.43
7.0.200.0010.00816.18
7.0.190.0030.00615.30
7.0.180.0070.00715.50
7.0.170.0000.00915.41
7.0.160.0030.01015.38
7.0.150.0030.01215.62
7.0.140.0000.01615.68
7.0.130.0090.00615.24
7.0.120.0030.00915.62
7.0.110.0050.00515.57
7.0.100.0070.00715.71
7.0.90.0030.00615.32
7.0.80.0030.00615.52
7.0.70.0130.00015.71
7.0.60.0070.02018.73
7.0.50.0020.02616.70
7.0.40.0030.05116.85
7.0.30.0180.03816.93
7.0.20.0200.04317.01
7.0.10.0080.04316.88
7.0.00.0100.04016.83
5.6.380.0040.00814.14
5.6.370.0090.00614.40
5.6.360.0070.00314.48
5.6.350.0080.00414.53
5.6.340.0130.00614.66
5.6.330.0000.01114.46
5.6.320.0050.00814.68
5.6.310.0030.00714.57
5.6.300.0030.01314.66
5.6.290.0090.00614.33
5.6.280.0020.02117.81
5.6.270.0110.00314.32
5.6.260.0030.00714.41
5.6.250.0060.00614.43
5.6.240.0090.00614.32
5.6.230.0000.01014.29
5.6.220.0000.01114.55
5.6.210.0080.04517.37
5.6.200.0090.04216.40
5.6.190.0040.02817.47
5.6.180.0050.02917.60
5.6.170.0220.03017.44
5.6.160.0090.04017.44
5.6.150.0040.02416.20
5.6.140.0100.04016.37
5.6.130.0070.04516.29
5.6.120.0080.04317.69
5.6.110.0100.03817.76
5.6.100.0100.04317.65
5.6.90.0070.04417.84
5.6.80.0080.03217.31
5.6.70.0090.00614.31
5.6.60.0090.00614.37
5.6.50.0090.00014.48
5.6.40.0030.00614.61
5.6.30.0030.00614.16
5.6.20.0030.01014.28
5.6.10.0100.00614.07
5.6.00.0030.01314.26
5.5.380.0030.00811.34
5.5.370.0100.00011.35
5.5.360.0070.00711.33
5.5.350.2200.02215.88
5.5.340.0080.01814.61
5.5.330.0080.03315.92
5.5.320.0330.03815.88
5.5.310.0130.03315.79
5.5.300.0050.04214.67
5.5.290.0050.04314.52
5.5.280.0040.03815.99
5.5.270.0080.04316.13
5.5.260.0050.02416.13
5.5.250.0010.04415.91
5.5.240.0090.02715.78
5.5.230.0040.00710.91
5.5.220.0000.00611.23
5.5.210.0030.00311.29
5.5.200.0040.00411.25
5.5.190.0000.00711.13
5.5.180.0030.01011.36
5.5.170.0040.00711.37
5.5.160.0040.00811.04
5.5.150.0000.01311.24
5.5.140.0040.00310.98
5.5.130.0000.00911.12
5.5.120.0060.00611.34
5.5.110.0030.00911.38
5.5.100.0030.00610.81
5.5.90.0030.00811.40
5.5.80.0040.00411.38
5.5.70.0030.00911.34
5.5.60.0040.00411.31
5.5.50.0000.00710.97
5.5.40.0030.00310.95
5.5.30.0060.00311.33
5.5.20.0050.00511.36
5.5.10.0000.00811.16
5.5.00.0040.00411.27
5.4.450.0630.06319.32
5.4.440.0530.06319.27
5.4.430.0600.05319.53
5.4.420.0530.06719.26
5.4.410.0470.05719.50
5.4.400.0670.05319.30
5.4.390.0770.04319.25
5.4.380.0530.06019.29
5.4.370.0630.05319.23
5.4.360.0570.05719.09
5.4.350.0570.05719.22
5.4.340.0770.05319.28
5.4.320.0770.05019.13
5.4.310.0830.04319.13
5.4.300.0730.05019.30
5.4.290.0770.05019.21
5.4.280.0830.05019.21
5.4.270.0600.05319.18
5.4.260.0700.04019.28
5.4.250.0600.05319.25
5.4.240.0630.05319.27
5.4.230.0700.05019.20
5.4.220.0770.05319.28
5.4.210.0800.05319.09
5.4.200.0630.05319.20
5.4.190.0630.05019.08
5.4.180.0630.05318.92
5.4.170.0530.05719.11
5.4.160.0730.03719.21
5.4.150.0670.05718.92
5.4.140.0800.06016.56
5.4.130.0800.04316.57
5.4.120.0870.03716.43
5.4.110.0670.04316.56
5.3.290.0670.06014.62
5.3.280.0770.05014.64
5.3.270.0630.05014.52
5.3.260.0570.05714.59
5.3.250.0830.04714.61
5.3.240.0700.05714.75
5.3.230.0730.05014.64
5.3.220.0570.05314.72
5.3.210.0630.05014.48