3v4l.org

run code in 300+ PHP versions simultaneously
<?php $us_states = array( 'alabama', 'arkansas', 'california', 'colorado', 'connecticut', 'delaware', 'district_of_columbia', 'florida', 'georgia', 'hawaii', 'idaho', 'illinois', 'indiana', 'iowa', 'kansas', 'kentucky', 'louisiana', 'maine', 'maryland', 'massachusetts', 'michigan', 'minnesota', 'mississippi', 'missouri', 'montana', 'nebraska', 'nevada', 'new_hampshire', 'new_jersey', 'new_mexico', 'new_york', 'north_carolina', 'north_dakota', 'ohio', 'oklahoma', 'oregon', 'pennsylvania', 'rhode_island', 'south_carolina', 'south_dakota', 'tennessee', 'texas', 'utah', 'vermont', 'virginia', 'washington', 'west_virginia', 'wisconsin', 'wyoming' ); $us_states = array_map( function ( $val ) { $obj = new StdClass(); $obj->$val = $val; return $obj; }, $us_states ); var_dump( $us_states ); // array_unshift( // $us_states, // new StdClass() // ); // var_dump( $us_states ); var_dump( array_merge( [new StdClass()], $us_states ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1hsRH
function name:  (null)
number of ops:  21
compiled vars:  !0 = $us_states
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   15     1        INIT_FCALL                                               'array_map'
   16     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F1hsRH%3A16%240'
   20     3        SEND_VAL                                                 ~2
   21     4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
   15     6        ASSIGN                                                   !0, $3
   24     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   33    10        INIT_FCALL                                               'var_dump'
         11        INIT_FCALL                                               'array_merge'
         12        NEW                                              $6      'StdClass'
         13        DO_FCALL                                      0          
         14        INIT_ARRAY                                       ~8      $6
         15        SEND_VAL                                                 ~8
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $9      
         18        SEND_VAR                                                 $9
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F1hsRH%3A16%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1hsRH
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $val, !1 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        NEW                                              $2      'StdClass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $2
   18     4        ASSIGN_OBJ                                               !1, !0
          5        OP_DATA                                                  !0
   19     6      > RETURN                                                   !1
   20     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F1hsRH%3A16%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.52 ms | 1396 KiB | 19 Q