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]);
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0
array ( 0 => 'getDataNlp:begin declare continue handler for sqlexception', )
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.

preferences:
130.63 ms | 407 KiB | 5 Q