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(translate(photographer,$searchKeyword) )]"); print_r($area);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/juiKg
function name:  (null)
number of ops:  17
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        ROPE_INIT                                     3  ~10     '%2F%2Farea%5Bcontains%28translate%28photographer%2C'
          8        ROPE_ADD                                      1  ~10     ~10, !2
          9        ROPE_END                                      2  ~9      ~10, '%29+%29%5D'
         10        SEND_VAL_EX                                              ~9
         11        DO_FCALL                                      0  $12     
         12        ASSIGN                                                   !3, $12
   32    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !3
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.85 ms | 1395 KiB | 15 Q