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(27); echo teste(18); //echo teste('a');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fOqhd
function name:  (null)
number of ops:  14
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                                                 
   16     5        INIT_FCALL                                               'teste'
          6        SEND_VAL                                                 27
          7        DO_FCALL                                      0  $2      
          8        ECHO                                                     $2
   17     9        INIT_FCALL                                               'teste'
         10        SEND_VAL                                                 18
         11        DO_FCALL                                      0  $3      
         12        ECHO                                                     $3
   18    13      > RETURN                                                   1

Function teste:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fOqhd
function name:  teste
number of ops:  8
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%2FfOqhd%3A4%240'
          2        BIND_LEXICAL                                             ~2, !0
          3        ASSIGN                                                   !1, ~2
   12     4        INIT_DYNAMIC_CALL                                        !1
          5        DO_FCALL                                      0  $4      
          6      > RETURN                                                   $4
   13     7*     > RETURN                                                   null

End of function teste

Function %00%7Bclosure%7D%2Fin%2FfOqhd%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/fOqhd
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%2FfOqhd%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.05 ms | 1403 KiB | 21 Q