3v4l.org

run code in 500+ PHP versions simultaneously
<?php // Hack declaration function _expr($v) { return $v; } $_expr = '_expr'; // Our playground define('qwe', 'asd'); define('zxc', 5); $a=3; $b=4; function c($a, $b) { return $a+$b; } // Usage echo "pre {$_expr(1+2)} post\n"; // outputs 'pre 3 post' echo "pre {$_expr(qwe)} post\n"; // outputs 'pre asd post' echo "pre {$_expr(c($a, $b)+zxc*2)} post\n"; // outputs 'pre 17 post' // General syntax is {$_expr(...)}
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aPCSD
function name:  (null)
number of ops:  41
compiled vars:  !0 = $_expr, !1 = $a, !2 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                       !0, '_expr'
   12     1        INIT_FCALL                                                   'define'
          2        SEND_VAL                                                     'qwe'
          3        SEND_VAL                                                     'asd'
          4        DO_ICALL                                                     
   13     5        INIT_FCALL                                                   'define'
          6        SEND_VAL                                                     'zxc'
          7        SEND_VAL                                                     5
          8        DO_ICALL                                                     
   15     9        ASSIGN                                                       !1, 3
   16    10        ASSIGN                                                       !2, 4
   21    11        ROPE_INIT                                         3  ~10     'pre+'
         12        INIT_DYNAMIC_CALL                                            !0
         13        SEND_VAL_EX                                                  3
         14        DO_FCALL                                          0  $8      
         15        ROPE_ADD                                          1  ~10     ~10, $8
         16        ROPE_END                                          2  ~9      ~10, '+post%0A'
         17        ECHO                                                         ~9
   22    18        ROPE_INIT                                         3  ~15     'pre+'
         19        INIT_DYNAMIC_CALL                                            !0
         20        FETCH_CONSTANT                                       ~12     'qwe'
         21        SEND_VAL_EX                                                  ~12
         22        DO_FCALL                                          0  $13     
         23        ROPE_ADD                                          1  ~15     ~15, $13
         24        ROPE_END                                          2  ~14     ~15, '+post%0A'
         25        ECHO                                                         ~14
   23    26        ROPE_INIT                                         3  ~23     'pre+'
         27        INIT_DYNAMIC_CALL                                            !0
         28        INIT_FCALL                                                   'c'
         29        SEND_VAR                                                     !1
         30        SEND_VAR                                                     !2
         31        DO_FCALL                                          0  $17     
         32        FETCH_CONSTANT                                       ~18     'zxc'
         33        MUL                                                  ~19     ~18, 2
         34        ADD                                                  ~20     $17, ~19
         35        SEND_VAL_EX                                                  ~20
         36        DO_FCALL                                          0  $21     
         37        ROPE_ADD                                          1  ~23     ~23, $21
         38        ROPE_END                                          2  ~22     ~23, '+post%0A'
         39        ECHO                                                         ~22
   25    40      > RETURN                                                       1

Function _expr:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aPCSD
function name:  _expr
number of ops:  3
compiled vars:  !0 = $v
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
    6     1      > RETURN                                                       !0
    7     2*     > RETURN                                                       null

End of function _expr

Function c:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aPCSD
function name:  c
number of ops:  5
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        ADD                                                  ~2      !0, !1
          3      > RETURN                                                       ~2
          4*     > RETURN                                                       null

End of function c

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
186.15 ms | 3325 KiB | 15 Q