3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <?xml version="1.0" encoding="UTF-8"?> <root> <area> <photographer_id>1</photographer_id> <photographer>John</photographer> <image>a</image> </area> <area> <photographer_id>1</photographer_id> <photographer>John</photographer> <image>b</image> </area> <area> <photographer_id>1</photographer_id> <photographer>John</photographer> <image>c</image> </area> <area> <photographer_id>2</photographer_id> <photographer>Fred</photographer> <image>a</image> </area> </root> XML; $sxe = new SimpleXMLElement($xml); $searchKeyword = "Fred"; $area = $sxe->xpath("//area[contains(photographer,'".$searchKeyword."')]"); print_r($area);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LLtBJ
function name:  (null)
number of ops:  16
compiled vars:  !0 = $xml, !1 = $sxe, !2 = $searchKeyword, !3 = $area
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0A%3Croot%3E%0A++++%3Carea%3E%0A++++++++%3Cphotographer_id%3E1%3C%2Fphotographer_id%3E%0A++++++++%3Cphotographer%3EJohn%3C%2Fphotographer%3E%0A++++++++%3Cimage%3Ea%3C%2Fimage%3E%0A++++%3C%2Farea%3E%0A++++%3Carea%3E%0A++++++++%3Cphotographer_id%3E1%3C%2Fphotographer_id%3E%0A++++++++%3Cphotographer%3EJohn%3C%2Fphotographer%3E%0A++++++++%3Cimage%3Eb%3C%2Fimage%3E%0A++++%3C%2Farea%3E%0A++++%3Carea%3E%0A++++++++%3Cphotographer_id%3E1%3C%2Fphotographer_id%3E%0A++++++++%3Cphotographer%3EJohn%3C%2Fphotographer%3E%0A++++++++%3Cimage%3Ec%3C%2Fimage%3E%0A++++%3C%2Farea%3E%0A++++%3Carea%3E%0A++++++++%3Cphotographer_id%3E2%3C%2Fphotographer_id%3E%0A++++++++%3Cphotographer%3EFred%3C%2Fphotographer%3E%0A++++++++%3Cimage%3Ea%3C%2Fimage%3E%0A++++%3C%2Farea%3E%0A%3C%2Froot%3E'
   28     1        NEW                                              $5      'SimpleXMLElement'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $5
   29     5        ASSIGN                                                   !2, 'Fred'
   30     6        INIT_METHOD_CALL                                         !1, 'xpath'
          7        CONCAT                                           ~9      '%2F%2Farea%5Bcontains%28photographer%2C%27', !2
          8        CONCAT                                           ~10     ~9, '%27%29%5D'
          9        SEND_VAL_EX                                              ~10
         10        DO_FCALL                                      0  $11     
         11        ASSIGN                                                   !3, $11
   32    12        INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !3
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.28 ms | 1395 KiB | 15 Q