3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f($code){ return 'pa' === strtolower(substr($code, 0, 2)); } var_dump([ 'pa05' => f('pa05'), 'pa08' => f('pa08'), 'c10' => f('c10'), 'test' => f('test'), ]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bhK1S
function name:  (null)
number of ops:  20
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
    8     1        INIT_FCALL                                               'f'
          2        SEND_VAL                                                 'pa05'
          3        DO_FCALL                                      0  $0      
          4        INIT_ARRAY                                       ~1      $0, 'pa05'
    9     5        INIT_FCALL                                               'f'
          6        SEND_VAL                                                 'pa08'
          7        DO_FCALL                                      0  $2      
          8        ADD_ARRAY_ELEMENT                                ~1      $2, 'pa08'
   10     9        INIT_FCALL                                               'f'
         10        SEND_VAL                                                 'c10'
         11        DO_FCALL                                      0  $3      
         12        ADD_ARRAY_ELEMENT                                ~1      $3, 'c10'
   11    13        INIT_FCALL                                               'f'
         14        SEND_VAL                                                 'test'
         15        DO_FCALL                                      0  $4      
         16        ADD_ARRAY_ELEMENT                                ~1      $4, 'test'
         17        SEND_VAL                                                 ~1
         18        DO_ICALL                                                 
   12    19      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bhK1S
function name:  f
number of ops:  12
compiled vars:  !0 = $code
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'strtolower'
          2        INIT_FCALL                                               'substr'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 0
          5        SEND_VAL                                                 2
          6        DO_ICALL                                         $1      
          7        SEND_VAR                                                 $1
          8        DO_ICALL                                         $2      
          9        IS_IDENTICAL                                     ~3      $2, 'pa'
         10      > RETURN                                                   ~3
    5    11*     > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.53 ms | 1399 KiB | 23 Q