3v4l.org

run code in 500+ PHP versions simultaneously
<?php ini_set('display_startup_errors', 1); ini_set('display_errors', 1); error_reporting(-1); function test1($type) { return $type === 'foo'; } function test2($type) { return $type === 'bar'; } $value = 'teststring'; foreach (['foo', 'bar'] as $type) { $isDefined = test1($type); $shouldBeTextArea = mb_strlen($value) > 255; if ($isDefined) { continue; } if ($shouldBeTextArea) { $inputType = self::TEXT_AREA_INPUT_TYPE; } } foreach (['foo', 'bar'] as $type) { $isDefined = test2($type); $shouldBeTextArea = mb_strlen($value) > 255; if ($isDefined) { continue; } if ($shouldBeTextArea) { $inputType = self::TEXT_AREA_INPUT_TYPE; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 29
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 29
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 25
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 28
Branch analysis from position: 29
2 jumps found. (Code = 77) Position 1 = 31, Position 2 = 47
Branch analysis from position: 31
2 jumps found. (Code = 78) Position 1 = 32, Position 2 = 47
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 43
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 46
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 46
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
Branch analysis from position: 29
filename:       /in/fuGjJ
function name:  (null)
number of ops:  49
compiled vars:  !0 = $value, !1 = $type, !2 = $isDefined, !3 = $shouldBeTextArea, !4 = $inputType
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'ini_set'
          1        SEND_VAL                                                     'display_startup_errors'
          2        SEND_VAL                                                     1
          3        DO_ICALL                                                     
    4     4        INIT_FCALL                                                   'ini_set'
          5        SEND_VAL                                                     'display_errors'
          6        SEND_VAL                                                     1
          7        DO_ICALL                                                     
    5     8        INIT_FCALL                                                   'error_reporting'
          9        SEND_VAL                                                     -1
         10        DO_ICALL                                                     
   15    11        ASSIGN                                                       !0, 'teststring'
   17    12      > FE_RESET_R                                           $9      <array>, ->29
         13    > > FE_FETCH_R                                                   $9, !1, ->29
   18    14    >   INIT_FCALL                                                   'test1'
         15        SEND_VAR                                                     !1
         16        DO_FCALL                                          0  $10     
         17        ASSIGN                                                       !2, $10
   19    18        INIT_FCALL                                                   'mb_strlen'
         19        SEND_VAR                                                     !0
         20        DO_ICALL                                             $12     
         21        IS_SMALLER                                           ~13     255, $12
         22        ASSIGN                                                       !3, ~13
   21    23      > JMPZ                                                         !2, ->25
   22    24    > > JMP                                                          ->13
   25    25    > > JMPZ                                                         !3, ->28
   26    26    >   FETCH_CLASS_CONSTANT                                 ~15     'TEXT_AREA_INPUT_TYPE'
         27        ASSIGN                                                       !4, ~15
   17    28    > > JMP                                                          ->13
         29    >   FE_FREE                                                      $9
   30    30      > FE_RESET_R                                           $17     <array>, ->47
         31    > > FE_FETCH_R                                                   $17, !1, ->47
   31    32    >   INIT_FCALL                                                   'test2'
         33        SEND_VAR                                                     !1
         34        DO_FCALL                                          0  $18     
         35        ASSIGN                                                       !2, $18
   32    36        INIT_FCALL                                                   'mb_strlen'
         37        SEND_VAR                                                     !0
         38        DO_ICALL                                             $20     
         39        IS_SMALLER                                           ~21     255, $20
         40        ASSIGN                                                       !3, ~21
   34    41      > JMPZ                                                         !2, ->43
   35    42    > > JMP                                                          ->31
   38    43    > > JMPZ                                                         !3, ->46
   39    44    >   FETCH_CLASS_CONSTANT                                 ~23     'TEXT_AREA_INPUT_TYPE'
         45        ASSIGN                                                       !4, ~23
   30    46    > > JMP                                                          ->31
         47    >   FE_FREE                                                      $17
   41    48      > RETURN                                                       1

Function test1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fuGjJ
function name:  test1
number of ops:  4
compiled vars:  !0 = $type
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
    8     1        IS_IDENTICAL                                         ~1      !0, 'foo'
          2      > RETURN                                                       ~1
    9     3*     > RETURN                                                       null

End of function test1

Function test2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fuGjJ
function name:  test2
number of ops:  4
compiled vars:  !0 = $type
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   RECV                                                 !0      
   12     1        IS_IDENTICAL                                         ~1      !0, 'bar'
          2      > RETURN                                                       ~1
   13     3*     > RETURN                                                       null

End of function test2

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
140.4 ms | 487 KiB | 12 Q