3v4l.org

run code in 500+ PHP versions simultaneously
<?php $test = array('customer-test1' => 1, 'customer-test2' => 2); function getPost($param) { global $test; echo addslashes($param)." = ".$test[$param]."<br/>"; return isset($test[$param]) ? $test[$param] : NULL; } class Customer { private $test1; private $test2; function __construct() { } } $object = new Customer(); $arr = (array)$object; $newArr = array(); foreach($arr as $key => $val) { $newKey = str_replace(get_class($object), "", $key); $newArr[$newKey] = getPost(strtolower(get_class($object))."-".$newKey); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 26
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 26
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/vgfI1
function name:  (null)
number of ops:  28
compiled vars:  !0 = $test, !1 = $object, !2 = $arr, !3 = $newArr, !4 = $val, !5 = $key, !6 = $newKey
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   13     1        NEW                                                  $8      'Customer'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !1, $8
   14     4        CAST                                              7  ~11     !1
          5        ASSIGN                                                       !2, ~11
   15     6        ASSIGN                                                       !3, <array>
   16     7      > FE_RESET_R                                           $14     !2, ->26
          8    > > FE_FETCH_R                                           ~15     $14, !4, ->26
          9    >   ASSIGN                                                       !5, ~15
   17    10        GET_CLASS                                            ~17     !1
         11        FRAMELESS_ICALL_3                str_replace         ~18     ~17, ''
         12        OP_DATA                                                      !5
         13        ASSIGN                                                       !6, ~18
   18    14        INIT_FCALL                                                   'getpost'
         15        INIT_FCALL                                                   'strtolower'
         16        GET_CLASS                                            ~21     !1
         17        SEND_VAL                                                     ~21
         18        DO_ICALL                                             $22     
         19        CONCAT                                               ~23     $22, '-'
         20        CONCAT                                               ~24     ~23, !6
         21        SEND_VAL                                                     ~24
         22        DO_FCALL                                          0  $25     
         23        ASSIGN_DIM                                                   !3, !6
         24        OP_DATA                                                      $25
   16    25      > JMP                                                          ->8
         26    >   FE_FREE                                                      $14
   19    27      > RETURN                                                       1

Function getpost:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vgfI1
function name:  getPost
number of ops:  18
compiled vars:  !0 = $param, !1 = $test
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    4     1        BIND_GLOBAL                                                  !1, 'test'
    5     2        INIT_FCALL                                                   'addslashes'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $2      
          5        CONCAT                                               ~3      $2, '+%3D+'
          6        FETCH_DIM_R                                          ~4      !1, !0
          7        CONCAT                                               ~5      ~3, ~4
          8        CONCAT                                               ~6      ~5, '%3Cbr%2F%3E'
          9        ECHO                                                         ~6
    6    10        ISSET_ISEMPTY_DIM_OBJ                             0          !1, !0
         11      > JMPZ                                                         ~7, ->15
         12    >   FETCH_DIM_R                                          ~8      !1, !0
         13        QM_ASSIGN                                            ~9      ~8
         14      > JMP                                                          ->16
         15    >   QM_ASSIGN                                            ~9      null
         16    > > RETURN                                                       ~9
    7    17*     > RETURN                                                       null

End of function getpost

Class Customer:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vgfI1
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                       null

End of function __construct

End of class Customer.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.06 ms | 2600 KiB | 16 Q