3v4l.org

run code in 300+ PHP versions simultaneously
<?php $js='{ "code": 1, "page": { "totalpage": 20, "count":10, "curr":1, "totalcount": 180 }, "data": [{ "id":3, "name":"jennifer" "age": 23, "sex": "female" },{ "id":5, "name":"lenbo" "age": 21, "sex": "male" }] }'; $arr=[['name'=>[3,'age'=>4],2],[3,'age'=>4]]; echo json_encode($arr); $test1 = 123; $test2 = 123; function get_variable_name(&$var, $scope = NULL) { if (NULL == $scope) { $scope = $GLOBALS; } $tmp = $var; //$var = "tmp_exists_" . mt_rand(); $name = array_search($var, $scope, TRUE); $var = $tmp; return $name; } echo get_variable_name($test1)."\n"; echo get_variable_name($test2);var_dump($GLOBALS);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uMljG
function name:  (null)
number of ops:  22
compiled vars:  !0 = $js, !1 = $arr, !2 = $test1, !3 = $test2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%7B%0A++++%22code%22%3A+1%2C%0A++++%22page%22%3A+%7B%0A++++++++%22totalpage%22%3A+20%2C+%0A++++++++%22count%22%3A10%2C++++%0A++++++++%22curr%22%3A1%2C++++%0A++++++++%22totalcount%22%3A+180+%0A++++%7D%2C%0A++++%22data%22%3A+%5B%7B%0A+++++++++%22id%22%3A3%2C%0A+++++++++%22name%22%3A%22jennifer%22%0A+++++++++%22age%22%3A+23%2C%0A+++++++++%22sex%22%3A+%22female%22%0A+++++%7D%2C%7B%0A+++++++++%22id%22%3A5%2C%0A+++++++++%22name%22%3A%22lenbo%22%0A+++++++++%22age%22%3A+21%2C%0A+++++++++%22sex%22%3A+%22male%22%0A+++++%7D%5D%0A%7D'
   24     1        ASSIGN                                                   !1, <array>
   25     2        INIT_FCALL                                               'json_encode'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $6      
          5        ECHO                                                     $6
   28     6        ASSIGN                                                   !2, 123
   29     7        ASSIGN                                                   !3, 123
   46     8        INIT_FCALL                                               'get_variable_name'
          9        SEND_REF                                                 !2
         10        DO_FCALL                                      0  $9      
         11        CONCAT                                           ~10     $9, '%0A'
         12        ECHO                                                     ~10
   47    13        INIT_FCALL                                               'get_variable_name'
         14        SEND_REF                                                 !3
         15        DO_FCALL                                      0  $11     
         16        ECHO                                                     $11
         17        INIT_FCALL                                               'var_dump'
         18        FETCH_R                      global              ~12     'GLOBALS'
         19        SEND_VAL                                                 ~12
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Function get_variable_name:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/uMljG
function name:  get_variable_name
number of ops:  16
compiled vars:  !0 = $var, !1 = $scope, !2 = $tmp, !3 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
   31     2        IS_EQUAL                                                 !1, null
          3      > JMPZ                                                     ~4, ->6
   32     4    >   FETCH_R                      global              ~5      'GLOBALS'
          5        ASSIGN                                                   !1, ~5
   35     6    >   ASSIGN                                                   !2, !0
   39     7        INIT_FCALL                                               'array_search'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !1
         10        SEND_VAL                                                 <true>
         11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !3, $8
   41    13        ASSIGN                                                   !0, !2
   43    14      > RETURN                                                   !3
   44    15*     > RETURN                                                   null

End of function get_variable_name

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.37 ms | 1402 KiB | 21 Q