3v4l.org

run code in 300+ PHP versions simultaneously
<?php function tryit($operand) { echo str_pad($operand, 4, ' ', STR_PAD_RIGHT); try { eval("\$a = []; \$a $operand \$a;"); echo "ok\n"; } catch (\Throwable $e) { echo $e->getMessage(), "\n"; } } tryit('+'); tryit('-'); tryit('-'); tryit('*'); tryit('/'); tryit('.'); tryit('**'); tryit('<=>');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mt071
function name:  (null)
number of ops:  25
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'tryit'
          1        SEND_VAL                                                 '%2B'
          2        DO_FCALL                                      0          
   14     3        INIT_FCALL                                               'tryit'
          4        SEND_VAL                                                 '-'
          5        DO_FCALL                                      0          
   15     6        INIT_FCALL                                               'tryit'
          7        SEND_VAL                                                 '-'
          8        DO_FCALL                                      0          
   16     9        INIT_FCALL                                               'tryit'
         10        SEND_VAL                                                 '%2A'
         11        DO_FCALL                                      0          
   17    12        INIT_FCALL                                               'tryit'
         13        SEND_VAL                                                 '%2F'
         14        DO_FCALL                                      0          
   18    15        INIT_FCALL                                               'tryit'
         16        SEND_VAL                                                 '.'
         17        DO_FCALL                                      0          
   19    18        INIT_FCALL                                               'tryit'
         19        SEND_VAL                                                 '%2A%2A'
         20        DO_FCALL                                      0          
   20    21        INIT_FCALL                                               'tryit'
         22        SEND_VAL                                                 '%3C%3D%3E'
         23        DO_FCALL                                      0          
         24      > RETURN                                                   1

Function tryit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 14
Branch analysis from position: 14
2 jumps found. (Code = 107) Position 1 = 15, Position 2 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mt071
function name:  tryit
number of ops:  20
compiled vars:  !0 = $operand, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'str_pad'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 4
          4        SEND_VAL                                                 '+'
          5        SEND_VAL                                                 1
          6        DO_ICALL                                         $2      
          7        ECHO                                                     $2
    6     8        ROPE_INIT                                     3  ~4      '%24a+%3D+%5B%5D%3B+%24a+'
          9        ROPE_ADD                                      1  ~4      ~4, !0
         10        ROPE_END                                      2  ~3      ~4, '+%24a%3B'
         11        INCLUDE_OR_EVAL                                          ~3, EVAL
    7    12        ECHO                                                     'ok%0A'
         13      > JMP                                                      ->19
    8    14  E > > CATCH                                       last         'Throwable'
    9    15    >   INIT_METHOD_CALL                                         !1, 'getMessage'
         16        DO_FCALL                                      0  $7      
         17        ECHO                                                     $7
         18        ECHO                                                     '%0A'
   11    19    > > RETURN                                                   null

End of function tryit

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.61 ms | 948 KiB | 24 Q