3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ElasticSearchQuery extends SimpleXMLElement { public function __toString() { return json_encode($this); } } $query = new ElasticSearchQuery('<root />'); $query->query->filtered->filter->term = 'foo'; echo $query;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6OuZA
function name:  (null)
number of ops:  12
compiled vars:  !0 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'elasticsearchquery', 'simplexmlelement'
   10     1        NEW                                              $1      'ElasticSearchQuery'
          2        SEND_VAL_EX                                              '%3Croot+%2F%3E'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   11     5        FETCH_OBJ_W                                      $4      !0, 'query'
          6        FETCH_OBJ_W                                      $5      $4, 'filtered'
          7        FETCH_OBJ_W                                      $6      $5, 'filter'
          8        ASSIGN_OBJ                                               $6, 'term'
          9        OP_DATA                                                  'foo'
   12    10        ECHO                                                     !0
         11      > RETURN                                                   1

Class ElasticSearchQuery:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6OuZA
function name:  __toString
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'json_encode'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                         $1      
          4        VERIFY_RETURN_TYPE                                       $1
          5      > RETURN                                                   $1
    7     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function __tostring

End of class ElasticSearchQuery.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.28 ms | 1395 KiB | 15 Q