3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(phpversion()); function teste ($arg) { $var = function() use ($arg) { if(filter_var($arg, FILTER_VALIDATE_INT)){ throw new Exception("It\'s not a INT\n"); } if($arg % 2 == 0) return 'PAR'; return 'IMPAR'; }; return $var; } echo teste('a'); echo teste(27); echo teste(18);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/10RNQ
function name:  (null)
number of ops:  18
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'phpversion'
          2        DO_ICALL                                         $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                                 
   15     5        INIT_FCALL                                               'teste'
          6        SEND_VAL                                                 'a'
          7        DO_FCALL                                      0  $2      
          8        ECHO                                                     $2
   16     9        INIT_FCALL                                               'teste'
         10        SEND_VAL                                                 27
         11        DO_FCALL                                      0  $3      
         12        ECHO                                                     $3
   17    13        INIT_FCALL                                               'teste'
         14        SEND_VAL                                                 18
         15        DO_FCALL                                      0  $4      
         16        ECHO                                                     $4
         17      > RETURN                                                   1

Function teste:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/10RNQ
function name:  teste
number of ops:  6
compiled vars:  !0 = $arg, !1 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F10RNQ%3A4%240'
          2        BIND_LEXICAL                                             ~2, !0
          3        ASSIGN                                                   !1, ~2
   12     4      > RETURN                                                   !1
   13     5*     > RETURN                                                   null

End of function teste

Function %00%7Bclosure%7D%2Fin%2F10RNQ%3A4%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/10RNQ
function name:  {closure}
number of ops:  16
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   BIND_STATIC                                              !0
    5     1        INIT_FCALL                                               'filter_var'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 257
          4        DO_ICALL                                         $1      
          5      > JMPZ                                                     $1, ->10
    6     6    >   NEW                                              $2      'Exception'
          7        SEND_VAL_EX                                              'It%5C%27s+not+a+INT%0A'
          8        DO_FCALL                                      0          
          9      > THROW                                         0          $2
    8    10    >   MOD                                              ~4      !0, 2
         11        IS_EQUAL                                                 ~4, 0
         12      > JMPZ                                                     ~5, ->14
         13    > > RETURN                                                   'PAR'
    9    14    > > RETURN                                                   'IMPAR'
   10    15*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F10RNQ%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.96 ms | 1403 KiB | 22 Q