3v4l.org

run code in 300+ 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 = 29
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 29
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/vgfI1
function name:  (null)
number of ops:  31
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, ->29
          8    > > FE_FETCH_R                                       ~15     $14, !4, ->29
          9    >   ASSIGN                                                   !5, ~15
   17    10        INIT_FCALL                                               'str_replace'
         11        GET_CLASS                                        ~17     !1
         12        SEND_VAL                                                 ~17
         13        SEND_VAL                                                 ''
         14        SEND_VAR                                                 !5
         15        DO_ICALL                                         $18     
         16        ASSIGN                                                   !6, $18
   18    17        INIT_FCALL                                               'getpost'
         18        INIT_FCALL                                               'strtolower'
         19        GET_CLASS                                        ~21     !1
         20        SEND_VAL                                                 ~21
         21        DO_ICALL                                         $22     
         22        CONCAT                                           ~23     $22, '-'
         23        CONCAT                                           ~24     ~23, !6
         24        SEND_VAL                                                 ~24
         25        DO_FCALL                                      0  $25     
         26        ASSIGN_DIM                                               !3, !6
         27        OP_DATA                                                  $25
   16    28      > JMP                                                      ->8
         29    >   FE_FREE                                                  $14
   19    30      > 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.0.0


preferences:
145.32 ms | 1007 KiB | 17 Q