3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<< XML <?xml version="1.0"?> <properties> <property> <propertyID>1</propertyID> <price>200</price> </property> <property> <propertyID>2</propertyID> <price>100</price> </property> <property> <propertyID>3</propertyID> <price>300</price> </property> </properties> XML; $xml = simplexml_load_string($xml); $properties = $xml->xpath("/properties/property"); usort($properties, function($a, $b) { return $b->price - $a->price; }); foreach($properties as $property) { echo $property->propertyID . "<br>"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 20
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/Gj120
function name:  (null)
number of ops:  22
compiled vars:  !0 = $xml, !1 = $properties, !2 = $property
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22%3F%3E%0A%3Cproperties%3E%0A+++%3Cproperty%3E%0A++++++%3CpropertyID%3E1%3C%2FpropertyID%3E%0A++++++%3Cprice%3E200%3C%2Fprice%3E%0A+++%3C%2Fproperty%3E%0A+++%3Cproperty%3E%0A++++++%3CpropertyID%3E2%3C%2FpropertyID%3E%0A++++++%3Cprice%3E100%3C%2Fprice%3E%0A+++%3C%2Fproperty%3E%0A+++%3Cproperty%3E%0A++++++%3CpropertyID%3E3%3C%2FpropertyID%3E%0A++++++%3Cprice%3E300%3C%2Fprice%3E%0A+++%3C%2Fproperty%3E%0A%3C%2Fproperties%3E'
   21     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !0, $4
   23     5        INIT_METHOD_CALL                                         !0, 'xpath'
          6        SEND_VAL_EX                                              '%2Fproperties%2Fproperty'
          7        DO_FCALL                                      0  $6      
          8        ASSIGN                                                   !1, $6
   25     9        INIT_FCALL                                               'usort'
         10        SEND_REF                                                 !1
         11        DECLARE_LAMBDA_FUNCTION                          ~8      [0]
   27    12        SEND_VAL                                                 ~8
   25    13        DO_ICALL                                                 
   29    14      > FE_RESET_R                                       $10     !1, ->20
         15    > > FE_FETCH_R                                               $10, !2, ->20
   30    16    >   FETCH_OBJ_R                                      ~11     !2, 'propertyID'
         17        CONCAT                                           ~12     ~11, '%3Cbr%3E'
         18        ECHO                                                     ~12
   29    19      > JMP                                                      ->15
         20    >   FE_FREE                                                  $10
   31    21      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Gj120
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   26     2        FETCH_OBJ_R                                      ~2      !1, 'price'
          3        FETCH_OBJ_R                                      ~3      !0, 'price'
          4        SUB                                              ~4      ~2, ~3
          5      > RETURN                                                   ~4
   27     6*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.92 ms | 1012 KiB | 15 Q