3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sql = <<<SQL getDataNlp:begin declare continue handler for sqlexception begin set returnCode = -1; set returnMsg = 'SQL Exception'; end; if useTransaction = 1 then start transaction; end if; set returnMsg = ''; set returnCode = 0; set @count = 0; set @orgName = orgName; set @orgId = ''; set @oprEmail = oprEmail; CreateOpr:BEGIN DECLARE idx INT DEFAULT 1; DECLARE v_orgName VARCHAR(128) DEFAULT ''; declare continue handler for sqlexception begin set returnCode = -1; set returnMsg = 'SQL Exception'; end; start transaction; set returnCode = 0; set returnMsg = ''; set @count = 0; set @oprName = oprName; select count(1) into @count from Opr where name = @oprName; if (@count > 0) then set returnCode = -1; set returnMsg = 'Opr with same oprName already exist'; rollback; leave CreateOpr; end if; END ;; SQL; $startWord = ':begin'; $endWord = 'sqlexception'; $maxLinesBetween = 4; preg_match_all('#.*' . preg_quote($startWord) . '.*(?:\R.*){0,' . $maxLinesBetween . '}.*' . preg_quote($endWord) . '.*?(?=\s*$)#im', $sql, $m); var_export($m[0]);

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)
8.4.120.0110.00524.15
8.4.110.0070.00120.60
8.4.100.0120.00918.90
8.4.90.0110.00720.68
8.4.80.0050.00418.14
8.4.70.0110.00917.86
8.4.60.0110.01019.77
8.4.50.0100.00819.78
8.4.40.0080.00317.99
8.4.30.0100.01020.75
8.4.20.0170.00319.71
8.4.10.0060.00919.52
8.3.250.0100.00918.86
8.3.240.0110.00816.99
8.3.230.0070.00216.69
8.3.220.0110.00517.23
8.3.210.0130.00616.91
8.3.200.0100.00916.57
8.3.190.0090.00616.65
8.3.180.0100.00416.80
8.3.170.0100.01018.94
8.3.160.0050.00518.58
8.3.150.0130.00719.14
8.3.140.0080.00020.81
8.3.130.0040.00418.52
8.3.120.0050.00520.85
8.3.110.0000.01120.94
8.3.100.0030.00624.06
8.3.90.0210.00026.77
8.3.80.0060.00318.56
8.3.70.0040.01116.60
8.3.60.0070.00716.61
8.3.50.0110.00316.70
8.3.40.0080.00620.34
8.3.30.0070.00719.40
8.3.20.0070.00024.18
8.3.10.0000.00824.66
8.3.00.0000.00826.16
8.2.290.0030.00620.37
8.2.280.0110.00818.45
8.2.270.0040.00417.18
8.2.260.0140.00317.40
8.2.250.0000.00818.75
8.2.240.0060.00317.31
8.2.230.0060.00322.58
8.2.220.0000.00937.54
8.2.210.0030.00526.77
8.2.200.0120.00017.00
8.2.190.0040.01116.63
8.2.180.0100.01018.26
8.2.170.0130.00619.01
8.2.160.0100.00322.96
8.2.150.0000.00825.66
8.2.140.0100.00624.66
8.2.130.0070.00326.16
8.2.120.0070.00419.61
8.2.110.0100.01322.11
8.2.100.0150.00821.08
8.2.90.0040.01820.80
8.2.80.0170.00720.92
8.2.70.0130.00620.82
8.2.60.0200.00320.70
8.2.50.0160.00720.77
8.2.40.0100.01020.76
8.2.30.0090.01320.66
8.2.20.0130.00720.64
8.2.10.0180.00421.11
8.2.00.0120.00920.93
8.1.330.0120.00721.98
8.1.320.0080.01016.29
8.1.310.0150.00418.67
8.1.300.0160.00016.43
8.1.290.0030.00630.84
8.1.280.0150.00025.92
8.1.270.0000.00724.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0070.01120.59
8.1.230.0120.00620.60
8.1.220.0100.00720.48
8.1.210.0180.00421.81
8.1.200.0190.00320.34
8.1.190.0140.01020.46
8.1.180.0120.00920.34
8.1.170.0110.00720.38
8.1.160.0190.00320.65
8.1.150.0030.00720.50
8.1.140.0070.01720.42
8.1.130.0150.00620.43
8.1.120.0070.01020.49
8.1.110.0070.00420.46
8.1.100.0030.00720.64
8.1.90.0030.00620.41
8.1.80.0100.00020.45
8.1.70.0060.00320.71
8.1.60.0160.00620.66
8.1.50.0170.00320.54
8.1.40.0100.00020.76
8.1.30.0060.00320.76
8.1.20.0150.00320.43
8.1.10.0130.01020.69
8.1.00.0100.01420.50
8.0.300.0000.01019.77
8.0.290.0160.00619.69
8.0.280.0100.00720.00
8.0.270.0040.01819.69
8.0.260.0030.00819.95
8.0.250.0110.00719.86
8.0.240.0090.00320.01
8.0.230.0060.00320.20
8.0.220.0100.00019.68
8.0.210.0160.00319.89
8.0.200.0000.01019.88
8.0.190.0060.00319.87
8.0.180.0100.00019.78
8.0.170.0060.00320.00
8.0.160.0060.00319.91
8.0.150.0090.00019.92
8.0.140.0060.00319.95
8.0.130.0100.00019.89
8.0.120.0050.00519.88
8.0.110.0090.00020.12
8.0.100.0000.01019.86
8.0.90.0000.00919.86
8.0.80.0130.00319.91
8.0.70.0180.00019.85
8.0.60.0030.00619.84
8.0.50.0060.00319.80
8.0.30.0000.01019.75
8.0.20.0090.00020.07
8.0.10.0030.00619.68

preferences:
29.05 ms | 403 KiB | 5 Q