3v4l.org

run code in 300+ PHP versions simultaneously
<?php $browser_list = ["test"]; $template_directory = "test"; function getTemplateProperties() { global $browser_list; global $template_directory; $data = '{ "data": { "template_folder": "templ", "browsers": [ {"name": "Chrome"}, {"name": "iOS"}, {"name":"Android"} ] }'; $json_data = json_decode($data, true); print_r($json_data); $browser_list=$json_data["data"]["browsers"]; print_r($browser_list); $template_directory=$json_data["data"]["template_folder"]; print_r($template_directory); } getTemplateProperties(); print_r( $browser_list); // outputs 15 echo "template dir: ".$template_directory; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M7rPn
function name:  (null)
number of ops:  10
compiled vars:  !0 = $browser_list, !1 = $template_directory
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, 'test'
   18     2        INIT_FCALL                                               'gettemplateproperties'
          3        DO_FCALL                                      0          
   19     4        INIT_FCALL                                               'print_r'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
   20     7        CONCAT                                           ~6      'template+dir%3A+', !1
          8        ECHO                                                     ~6
   21     9      > RETURN                                                   1

Function gettemplateproperties:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M7rPn
function name:  getTemplateProperties
number of ops:  24
compiled vars:  !0 = $browser_list, !1 = $template_directory, !2 = $data, !3 = $json_data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   BIND_GLOBAL                                              !0, 'browser_list'
    7     1        BIND_GLOBAL                                              !1, 'template_directory'
    8     2        ASSIGN                                                   !2, '%7B+%22data%22%3A+%7B+%22template_folder%22%3A+%22templ%22%2C+%22browsers%22%3A+%5B+%7B%22name%22%3A+%22Chrome%22%7D%2C+%7B%22name%22%3A+%22iOS%22%7D%2C+%7B%22name%22%3A%22Android%22%7D+%5D++%7D'
    9     3        INIT_FCALL                                               'json_decode'
          4        SEND_VAR                                                 !2
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !3, $5
   10     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !3
         10        DO_ICALL                                                 
   11    11        FETCH_DIM_R                                      ~8      !3, 'data'
         12        FETCH_DIM_R                                      ~9      ~8, 'browsers'
         13        ASSIGN                                                   !0, ~9
   12    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                                 
   13    17        FETCH_DIM_R                                      ~12     !3, 'data'
         18        FETCH_DIM_R                                      ~13     ~12, 'template_folder'
         19        ASSIGN                                                   !1, ~13
   15    20        INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
   16    23      > RETURN                                                   null

End of function gettemplateproperties

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.71 ms | 1390 KiB | 18 Q