3v4l.org

run code in 500+ PHP versions simultaneously
<?php $customer = new stdClass(); $customer->{"first-name"} = "NAME"; $customer->{"last-name"} = "NAME"; $customer->{"phone-numer"} = "NUMBER"; print_r($customer); foreach (get_object_vars($customer) as $key => $value) { $key2 = str_replace('-', '_', $key); $customer->$key2 = $customer->$key; unset($customer->$key); } print_r($customer);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 26
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 26
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/sfZq3
function name:  (null)
number of ops:  31
compiled vars:  !0 = $customer, !1 = $value, !2 = $key, !3 = $key2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   NEW                                                  $4      'stdClass'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $4
    4     3        ASSIGN_OBJ                                                   !0, 'first-name'
          4        OP_DATA                                                      'NAME'
    5     5        ASSIGN_OBJ                                                   !0, 'last-name'
          6        OP_DATA                                                      'NAME'
    6     7        ASSIGN_OBJ                                                   !0, 'phone-numer'
          8        OP_DATA                                                      'NUMBER'
    8     9        INIT_FCALL                                                   'print_r'
         10        SEND_VAR                                                     !0
         11        DO_ICALL                                                     
   10    12        INIT_FCALL                                                   'get_object_vars'
         13        SEND_VAR                                                     !0
         14        DO_ICALL                                             $11     
         15      > FE_RESET_R                                           $12     $11, ->26
         16    > > FE_FETCH_R                                           ~13     $12, !1, ->26
         17    >   ASSIGN                                                       !2, ~13
   11    18        FRAMELESS_ICALL_3                str_replace         ~15     '-', '_'
         19        OP_DATA                                                      !2
         20        ASSIGN                                                       !3, ~15
   12    21        FETCH_OBJ_R                                          ~18     !0, !2
         22        ASSIGN_OBJ                                                   !0, !3
         23        OP_DATA                                                      ~18
   13    24        UNSET_OBJ                                                    !0, !2
   10    25      > JMP                                                          ->16
         26    >   FE_FREE                                                      $12
   16    27        INIT_FCALL                                                   'print_r'
         28        SEND_VAR                                                     !0
         29        DO_ICALL                                                     
         30      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
169.56 ms | 1888 KiB | 15 Q