3v4l.org

run code in 500+ PHP versions simultaneously
<?php use function PHPStan\dumpType; final class SinglePickSKU { public function renderEditControls(string $id): string { preg_match('/(\d+)$/', $id, $result); $counter = ''; if (is_numeric($result[1])) { if ($result[1] < 10) { $counter = '0' . $result[1] . '. '; } else { $counter = $result[1] . '. '; } } var_dump($counter); $html = ''; $html .= doFoo($counter . 'abc'); return $html; } } function doFoo(string $s):string { return $s; } $s = new SinglePickSKU(); $s->renderEditControls('');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fbc2F
function name:  (null)
number of ops:  7
compiled vars:  !0 = $s
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   29     0  E >   NEW                                                  $1      'SinglePickSKU'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   30     3        INIT_METHOD_CALL                                             !0, 'renderEditControls'
          4        SEND_VAL_EX                                                  ''
          5        DO_FCALL                                          0          
          6      > RETURN                                                       1

Function dofoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fbc2F
function name:  doFoo
number of ops:  5
compiled vars:  !0 = $s
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   27     0  E >   RECV                                                 !0      
          1        VERIFY_RETURN_TYPE                                           !0
          2      > RETURN                                                       !0
          3*       VERIFY_RETURN_TYPE                                           
          4*     > RETURN                                                       null

End of function dofoo

Class SinglePickSKU:
Function rendereditcontrols:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 21
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/fbc2F
function name:  renderEditControls
number of ops:  34
compiled vars:  !0 = $id, !1 = $result, !2 = $counter, !3 = $html
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
    9     1        INIT_FCALL                                                   'preg_match'
          2        SEND_VAL                                                     '%2F%28%5Cd%2B%29%24%2F'
          3        SEND_VAR                                                     !0
          4        SEND_REF                                                     !1
          5        DO_ICALL                                                     
   10     6        ASSIGN                                                       !2, ''
   12     7        FETCH_DIM_R                                          ~6      !1, 1
          8        FRAMELESS_ICALL_1                is_numeric          ~7      ~6
          9      > JMPZ                                                         ~7, ->21
   13    10    >   FETCH_DIM_R                                          ~8      !1, 1
         11        IS_SMALLER                                                   ~8, 10
         12      > JMPZ                                                         ~9, ->18
   14    13    >   FETCH_DIM_R                                          ~10     !1, 1
         14        CONCAT                                               ~11     '0', ~10
         15        CONCAT                                               ~12     ~11, '.+'
         16        ASSIGN                                                       !2, ~12
   13    17      > JMP                                                          ->21
   16    18    >   FETCH_DIM_R                                          ~14     !1, 1
         19        CONCAT                                               ~15     ~14, '.+'
         20        ASSIGN                                                       !2, ~15
   19    21    >   INIT_FCALL                                                   'var_dump'
         22        SEND_VAR                                                     !2
         23        DO_ICALL                                                     
   20    24        ASSIGN                                                       !3, ''
   21    25        INIT_FCALL_BY_NAME                                           'doFoo'
         26        CONCAT                                               ~19     !2, 'abc'
         27        SEND_VAL_EX                                                  ~19
         28        DO_FCALL                                          0  $20     
         29        ASSIGN_OP                                         8          !3, $20
   23    30        VERIFY_RETURN_TYPE                                           !3
         31      > RETURN                                                       !3
   24    32*       VERIFY_RETURN_TYPE                                           
         33*     > RETURN                                                       null

End of function rendereditcontrols

End of class SinglePickSKU.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
152.75 ms | 800 KiB | 10 Q