3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = "define('DB_PASSWORD', 'fuuu'); fuuu"; $b = 'define("DB_PASSWORD", "fuuu"); fuuu'; $c = 'DEFINE("DB_PASSWORD", "fuuu"); fuuu'; $d = "DEFINE('DB_PASSWORD', 'fuuu'); fuuu"; $new = preg_quote("un}C)y~&tSzb"); echo preg_replace('/define\([\'\"]db_password[\'\"],\s*[\'\"]'.$new.'[\'\"]/i', 'define("DB_PASSWORD", "123456")', $a) . "\n"; echo preg_replace('/define\([\'\"]db_password[\'\"],\s*[\'\"]fuuu[\'\"]/i', 'define("DB_PASSWORD", "123456")', $b) . "\n"; echo preg_replace('/define\([\'\"]db_password[\'\"],\s*[\'\"]fuuu[\'\"]/i', 'define("DB_PASSWORD", "123456")', $c) . "\n"; echo preg_replace('/define\([\'\"]db_password[\'\"],\s*[\'\"]fuuu[\'\"]/i', 'define("DB_PASSWORD", "123456")', $d) . "\n";
based on YebU2

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.00.0030.01016.83
7.2.130.0040.00817.04
7.2.120.0060.00317.16
7.2.110.0070.00316.75
7.2.100.0180.00016.81
7.2.90.0070.00717.19
7.2.80.0090.00317.02
7.2.70.0000.01117.33
7.2.60.0030.01017.17
7.2.50.0120.00317.06
7.2.40.0060.00617.25
7.2.30.0140.00316.77
7.2.20.0040.00817.08
7.2.10.0080.00417.20
7.2.00.0060.00718.27
7.1.250.0000.00916.09
7.1.240.0030.00615.94
7.1.230.0050.00915.83
7.1.220.0000.00915.84
7.1.210.0050.00515.38
7.1.200.0040.00915.88
7.1.190.0080.00615.78
7.1.180.0040.00815.91
7.1.170.0080.00315.91
7.1.160.0070.00415.83
7.1.150.0040.00815.82
7.1.140.0170.00715.91
7.1.130.0060.00915.73
7.1.120.0080.00415.98
7.1.110.0000.00915.96
7.1.100.0120.00217.11
7.1.90.0120.00415.82
7.1.80.0100.00715.96
7.1.70.0040.00516.71
7.1.60.0080.00417.74
7.1.50.0110.00816.51
7.1.40.0100.00315.85
7.1.30.0030.00815.56
7.1.20.0030.00815.74
7.1.10.0090.00015.82
7.1.00.0110.03419.27
7.0.330.0060.00615.34
7.0.320.0130.00415.07
7.0.310.0120.00315.62
7.0.300.0040.01215.52
7.0.290.0120.00615.46
7.0.280.0040.00815.20
7.0.270.0030.01015.50
7.0.260.0030.00915.39
7.0.250.0050.00915.54
7.0.240.0030.00715.54
7.0.230.0060.00615.71
7.0.220.0130.00315.34
7.0.210.0000.01115.38
7.0.200.0050.00715.30
7.0.190.0030.00915.51
7.0.180.0120.00415.14
7.0.170.0030.00915.52
7.0.160.0140.00015.52
7.0.150.0000.01215.33
7.0.140.0050.03518.67
7.0.130.0040.00815.45
7.0.120.0070.00415.29
7.0.110.0190.00015.49
7.0.100.0100.00315.25
7.0.90.0180.00615.21
7.0.80.0150.00815.55
7.0.70.0230.00715.03
7.0.60.0200.03917.71
7.0.50.0120.02516.78
7.0.40.0150.03916.89
7.0.30.0240.03716.64
7.0.20.0210.04316.74
7.0.10.0210.02616.85
7.0.00.0040.03216.93
5.6.380.0090.00314.44
5.6.370.0000.01013.78
5.6.360.0000.01114.30
5.6.350.0080.00414.44
5.6.340.0120.00014.42
5.6.330.0100.00614.02
5.6.320.0120.00314.47
5.6.310.0030.00914.04
5.6.300.0070.01014.36
5.6.290.0110.00413.98
5.6.280.0160.03217.32
5.6.270.0080.00814.39
5.6.260.0160.00314.23
5.6.250.0210.00614.19
5.6.240.0160.00614.04
5.6.230.0210.00514.20
5.6.220.0420.00014.30
5.6.210.0260.03817.39
5.6.200.0200.02216.23
5.6.190.0190.02717.31
5.6.180.0390.04517.41
5.6.170.0230.03317.36
5.6.160.0170.03217.42
5.6.150.0200.04416.20
5.6.140.0110.03416.34
5.6.130.0140.04516.37
5.6.120.0190.02917.58
5.6.110.0130.03717.66
5.6.100.0210.03517.70
5.6.90.0120.04417.54
5.6.80.0050.02317.18
5.6.70.0230.03517.31
5.6.60.0100.00614.14
5.6.50.0030.01414.12
5.6.40.0160.00414.15
5.6.30.0210.00714.14
5.6.20.0060.01314.28
5.6.10.0120.00914.26
5.6.00.0030.01014.03
5.5.380.0030.00911.38
5.5.370.0070.01010.74
5.5.360.0310.00311.21
5.5.350.0200.04315.79
5.5.340.0210.04314.49
5.5.330.0130.03715.83
5.5.320.0030.03115.50
5.5.310.0260.03115.56
5.5.300.0120.02514.48
5.5.290.0030.02614.48
5.5.280.0080.03815.77
5.5.270.0220.03616.02
5.5.260.0110.02615.90
5.5.250.0150.02115.82
5.5.240.0170.03815.70
5.5.230.0140.00011.00
5.5.220.0120.00910.87
5.5.210.0140.00711.08
5.5.200.0050.00510.79
5.5.190.0100.00311.00
5.5.180.0040.00810.86
5.5.170.0080.00811.04
5.5.160.0030.00810.86
5.5.150.0060.00410.70
5.5.140.0160.00311.18
5.5.130.0110.00610.75
5.5.120.0090.00611.04
5.5.110.0030.00311.02
5.5.100.0060.00011.06
5.5.90.0000.00910.84
5.5.80.0030.00511.03
5.5.70.0040.00411.09
5.5.60.0030.00711.00
5.5.50.0030.00810.89
5.5.40.0040.00810.88
5.5.30.0110.00311.07
5.5.20.0050.00511.05
5.5.10.0180.00011.11
5.5.00.0130.00311.13
5.4.450.0370.02815.29
5.4.440.0570.03715.09
5.4.430.0540.03415.27
5.4.420.0500.02815.30
5.4.410.0160.02514.89
5.4.400.0280.03714.75
5.4.390.0240.04014.82
5.4.380.0330.03814.67
5.4.370.0270.03514.80
5.4.360.0320.03014.67
5.4.350.0220.04114.47
5.4.340.0830.03314.73
5.4.330.0080.00810.89
5.4.320.0390.03814.66
5.4.310.0240.03614.83
5.4.300.0300.03114.85
5.4.290.0300.03314.71
5.4.280.0240.02914.88
5.4.270.0270.04014.76
5.4.260.0310.03114.85
5.4.250.0300.03314.67
5.4.240.0210.03414.94
5.4.230.0350.02814.63
5.4.220.0240.04214.65
5.4.210.0210.03414.68
5.4.200.0180.03013.50
5.4.190.0200.03314.73
5.4.180.0250.02914.80
5.4.170.0300.03514.76
5.4.160.0280.03114.63
5.4.150.0870.04014.67
5.4.140.0240.03713.44
5.4.130.0290.03713.55
5.4.120.0260.02713.53
5.4.110.0370.03613.34
5.4.100.0540.03113.47
5.4.90.0220.04313.46
5.4.80.0210.02913.57
5.4.70.0390.02713.50
5.4.60.0260.03813.67
5.4.50.0210.03413.52
5.4.40.0230.03413.57
5.4.30.0280.03313.23
5.4.20.0250.03513.50
5.4.10.0260.02813.66
5.4.00.0470.03213.16
5.3.290.0270.03112.59
5.3.280.0520.02612.50
5.3.270.0560.03312.64
5.3.260.0510.04312.52
5.3.250.0580.03412.59
5.3.240.0320.03612.52
5.3.230.0250.03012.46
5.3.220.0300.02812.48
5.3.210.0460.03412.44
5.3.200.0280.03512.44
5.3.190.0300.03212.57
5.3.180.0270.03812.57
5.3.170.0370.03912.44
5.3.160.0590.03012.55
5.3.150.0310.02812.57
5.3.140.0510.02812.38
5.3.130.0190.04012.54
5.3.120.0240.03112.59
5.3.110.0290.03112.47
5.3.100.0250.03712.28
5.3.90.0520.02912.31
5.3.80.0280.03812.11
5.3.70.0270.03012.21
5.3.60.0570.02712.19
5.3.50.0280.03612.07
5.3.40.0460.04612.14
5.3.30.0320.02812.04
5.3.20.0220.03212.03
5.3.10.0560.02311.96
5.3.00.0210.03411.99
5.2.170.0170.02310.69
5.2.160.0370.03510.71
5.2.150.0220.02310.68
5.2.140.0180.02410.71
5.2.130.0200.03010.70
5.2.120.0200.02810.69
5.2.110.0600.02210.71
5.2.100.0270.01910.66
5.2.90.0180.03110.70
5.2.80.0210.03010.64
5.2.70.0670.02210.74
5.2.60.0260.02810.72
5.2.50.0210.02810.66
5.2.40.0160.02910.69
5.2.30.0620.02210.63
5.2.20.0280.02010.56
5.2.10.0510.03010.53
5.2.00.0210.02310.48
5.1.60.0220.02410.19
5.1.50.0200.02310.10
5.1.40.0130.03110.12
5.1.30.0630.02310.28
5.1.20.0310.01710.29
5.1.10.0250.02110.23
5.1.00.0130.03010.23
5.0.50.0150.0199.39
5.0.40.0170.0159.35
5.0.30.0100.0279.25
5.0.20.0180.0129.23
5.0.10.0100.0189.23
5.0.00.0070.0329.26
4.4.90.0100.0128.36
4.4.80.0060.0188.36
4.4.70.0160.0108.36
4.4.60.0070.0178.36
4.4.50.0120.0148.36
4.4.40.0100.0188.36
4.4.30.0120.0118.36
4.4.20.0110.0168.36
4.4.10.0100.0138.36
4.4.00.0090.0228.36
4.3.110.0080.0158.36
4.3.100.0080.0218.36
4.3.90.0040.0158.36
4.3.80.0080.0188.36
4.3.70.0130.0128.36
4.3.60.0120.0128.36
4.3.50.0060.0168.36
4.3.40.0120.0188.36
4.3.30.0050.0168.36
4.3.20.0030.0158.36
4.3.10.0130.0088.36
4.3.00.0050.0148.53