3v4l.org

run code in 500+ PHP versions simultaneously
<?php $client = (object) ['id' => 1]; $databaseValue = '$client->id'; preg_match_all('/^\$(?:[a-z]||[A-Z])\S+/', $databaseValue, $matches); if (!empty($matches)) { $firstVariableOccurance = current(current($matches)); eval("\$value = {$firstVariableOccurance};"); echo "send command {$value}"; } // it return me ^ "status $client->id", i.e. the variable is not executed
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 25
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/jgdlc
function name:  (null)
number of ops:  26
compiled vars:  !0 = $client, !1 = $databaseValue, !2 = $matches, !3 = $firstVariableOccurance, !4 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   CAST                                              8  ~5      <array>
          1        ASSIGN                                                       !0, ~5
    4     2        ASSIGN                                                       !1, '%24client-%3Eid'
    5     3        INIT_FCALL                                                   'preg_match_all'
          4        SEND_VAL                                                     '%2F%5E%5C%24%28%3F%3A%5Ba-z%5D%7C%7C%5BA-Z%5D%29%5CS%2B%2F'
          5        SEND_VAR                                                     !1
          6        SEND_REF                                                     !2
          7        DO_ICALL                                                     
    6     8        ISSET_ISEMPTY_CV                                     ~9      !2
          9        BOOL_NOT                                             ~10     ~9
         10      > JMPZ                                                         ~10, ->25
    7    11    >   INIT_FCALL                                                   'current'
         12        INIT_FCALL                                                   'current'
         13        SEND_VAR                                                     !2
         14        DO_ICALL                                             $11     
         15        SEND_VAR                                                     $11
         16        DO_ICALL                                             $12     
         17        ASSIGN                                                       !3, $12
    8    18        ROPE_INIT                                         3  ~15     '%24value+%3D+'
         19        ROPE_ADD                                          1  ~15     ~15, !3
         20        ROPE_END                                          2  ~14     ~15, '%3B'
         21        INCLUDE_OR_EVAL                                              ~14, EVAL
    9    22        NOP                                                          
         23        FAST_CONCAT                                          ~18     'send+command+', !4
         24        ECHO                                                         ~18
   11    25    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
177.64 ms | 1859 KiB | 14 Q