3v4l.org

run code in 500+ 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 = 4, Position 2 = 11
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/r0qO0
function name:  foo
number of ops:  13
compiled vars:  !0 = $v
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   RECV                                                 !0      
    3     1        FRAMELESS_ICALL_1                is_numeric          ~1      !0
          2        BOOL_NOT                                             ~2      ~1
          3      > JMPZ                                                         ~2, ->11
    4     4    >   INIT_FCALL_BY_NAME                                           'invalidArgument'
          5        SEND_VAL_EX                                                  'foo'
          6        SEND_VAL_EX                                                  'numeric'
          7        SEND_VAL_EX                                                  1
          8        GET_TYPE                                             ~3      !0
          9        SEND_VAL_EX                                                  ~3
         10        DO_FCALL                                          0          
    6    11    >   ECHO                                                         !0
    7    12      > 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:  30
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'
   19     8        FETCH_DIM_R                                          ~7      !4, 1
          9        FETCH_DIM_R                                          ~8      ~7, 'file'
   20    10        FETCH_DIM_R                                          ~9      !4, 1
         11        FETCH_DIM_R                                          ~10     ~9, 'line'
         12        ROPE_INIT                                        12  ~14     'Argument+'
         13        CAST                                              4  ~11     !2
         14        ROPE_ADD                                          1  ~14     ~14, ~11
         15        ROPE_ADD                                          2  ~14     ~14, '+passed+to+'
         16        ROPE_ADD                                          3  ~14     ~14, !0
         17        ROPE_ADD                                          4  ~14     ~14, '%28%29+must+be+a+valid+'
         18        ROPE_ADD                                          5  ~14     ~14, !1
         19        ROPE_ADD                                          6  ~14     ~14, '%2C+'
         20        ROPE_ADD                                          7  ~14     ~14, !3
         21        ROPE_ADD                                          8  ~14     ~14, '+given+in+'
         22        ROPE_ADD                                          9  ~14     ~14, ~8
         23        ROPE_ADD                                         10  ~14     ~14, '+on+line+'
         24        CAST                                              4  ~12     ~10
         25        ROPE_END                                         11  ~13     ~14, ~12
         26        SEND_VAL                                                     ~13
   22    27        SEND_VAL                                                     256
   12    28        DO_ICALL                                                     
   24    29      > RETURN                                                       null

End of function invalidargument

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
191.87 ms | 2937 KiB | 21 Q