3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo($v) { if (!is_numeric($v)) { invalidArgument(__FUNCTION__, 'numeric', 1, gettype($v)); } echo $v; } function invalidArgument($func, $type, $argN, $argT) { $db = debug_backtrace(); user_error( sprintf( "Argument %d passed to %s() must be a valid %s, %s given in %s on line %d", $argN, $func, $type, $argT, $db[1]['file'], $db[1]['line'] ), E_USER_ERROR ); } foo("9999999999999999999999999999999"); foo("abc");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r0qO0
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   INIT_FCALL                                               'foo'
          1        SEND_VAL                                                 '9999999999999999999999999999999'
          2        DO_FCALL                                      0          
   27     3        INIT_FCALL                                               'foo'
          4        SEND_VAL                                                 'abc'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/r0qO0
function name:  foo
number of ops:  15
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'is_numeric'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        BOOL_NOT                                         ~2      $1
          5      > JMPZ                                                     ~2, ->13
    4     6    >   INIT_FCALL_BY_NAME                                       'invalidArgument'
          7        SEND_VAL_EX                                              'foo'
          8        SEND_VAL_EX                                              'numeric'
          9        SEND_VAL_EX                                              1
         10        GET_TYPE                                         ~3      !0
         11        SEND_VAL_EX                                              ~3
         12        DO_FCALL                                      0          
    6    13    >   ECHO                                                     !0
    7    14      > RETURN                                                   null

End of function foo

Function invalidargument:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r0qO0
function name:  invalidArgument
number of ops:  25
compiled vars:  !0 = $func, !1 = $type, !2 = $argN, !3 = $argT, !4 = $db
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   11     4        INIT_FCALL                                               'debug_backtrace'
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !4, $5
   12     7        INIT_FCALL                                               'user_error'
   13     8        INIT_FCALL                                               'sprintf'
   14     9        SEND_VAL                                                 'Argument+%25d+passed+to+%25s%28%29+must+be+a+valid+%25s%2C+%25s+given+in+%25s+on+line+%25d'
   15    10        SEND_VAR                                                 !2
   16    11        SEND_VAR                                                 !0
   17    12        SEND_VAR                                                 !1
   18    13        SEND_VAR                                                 !3
   19    14        FETCH_DIM_R                                      ~7      !4, 1
         15        FETCH_DIM_R                                      ~8      ~7, 'file'
         16        SEND_VAL                                                 ~8
   20    17        FETCH_DIM_R                                      ~9      !4, 1
         18        FETCH_DIM_R                                      ~10     ~9, 'line'
         19        SEND_VAL                                                 ~10
   13    20        DO_ICALL                                         $11     
   20    21        SEND_VAR                                                 $11
   22    22        SEND_VAL                                                 256
   12    23        DO_ICALL                                                 
   24    24      > RETURN                                                   null

End of function invalidargument

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.47 ms | 1454 KiB | 19 Q