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]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BFtfN
function name:  (null)
number of ops:  26
compiled vars:  !0 = $sql, !1 = $startWord, !2 = $endWord, !3 = $maxLinesBetween, !4 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'getDataNlp%3Abegin%0A%0A%0A++++declare+continue+handler+for+sqlexception+%0A++++begin%0A++++++++set+returnCode+%3D+-1%3B%0A++++++++set+returnMsg+%3D+%27SQL+Exception%27%3B%0A++++end%3B%0A++++%0A++++if+useTransaction+%3D+1+then%0A++++++++start+transaction%3B%0A++++end+if%3B%0A++++%0A++++set+returnMsg+%3D+%27%27%3B%0A++++set+returnCode+%3D+0%3B%0A++++set+%40count+%3D+0%3B%0A++++set+%40orgName+%3D+orgName%3B%0A++++set+%40orgId+%3D+%27%27%3B%0A++++set+%40oprEmail+%3D+oprEmail%3B%0A%0ACreateOpr%3ABEGIN%0A%0A%0A++++DECLARE+idx+INT+DEFAULT+1%3B%0A++++DECLARE+v_orgName+VARCHAR%28128%29+DEFAULT+%27%27%3B%0A++++declare+continue+handler+for+sqlexception+%0A++++begin%0A++++++++set+returnCode+%3D+-1%3B%0A++++++++set+returnMsg+%3D+%27SQL+Exception%27%3B%0A++++end%3B%0A++++start+transaction%3B%0A%0A++++set+returnCode+%3D+0%3B%0A++++set+returnMsg+%3D+%27%27%3B%0A++++set+%40count+%3D+0%3B%0A++++set+%40oprName+%3D+oprName%3B%0A++++++++++++%0A++++select+count%281%29+into+%40count+from+Opr+where+name+%3D+%40oprName%3B%0A++++if+%28%40count+%3E+0%29+then%0A++++++++set+returnCode+%3D+-1%3B%0A++++++++set+returnMsg+%3D+%27Opr+with+same+oprName+already+exist%27%3B%0A++++++++rollback%3B%0A++++++++leave+CreateOpr%3B%0A++++end+if%3B%0A+%0AEND+%3B%3B'
   52     1        ASSIGN                                                   !1, '%3Abegin'
   53     2        ASSIGN                                                   !2, 'sqlexception'
   54     3        ASSIGN                                                   !3, 4
   55     4        INIT_FCALL                                               'preg_match_all'
          5        INIT_FCALL                                               'preg_quote'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $9      
          8        CONCAT                                           ~10     '%23.%2A', $9
          9        CONCAT                                           ~11     ~10, '.%2A%28%3F%3A%5CR.%2A%29%7B0%2C'
         10        CONCAT                                           ~12     ~11, !3
         11        CONCAT                                           ~13     ~12, '%7D.%2A'
         12        INIT_FCALL                                               'preg_quote'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                         $14     
         15        CONCAT                                           ~15     ~13, $14
         16        CONCAT                                           ~16     ~15, '.%2A%3F%28%3F%3D%5Cs%2A%24%29%23im'
         17        SEND_VAL                                                 ~16
         18        SEND_VAR                                                 !0
         19        SEND_REF                                                 !4
         20        DO_ICALL                                                 
   56    21        INIT_FCALL                                               'var_export'
         22        FETCH_DIM_R                                      ~18     !4, 0
         23        SEND_VAL                                                 ~18
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.66 ms | 1001 KiB | 16 Q