3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Does NOT work as expected. $sxml = simplexml_load_string('<test><num>20.5</num><den>1</den></test>'); $ans = $sxml->num / $sxml->den; echo "XML Test:\n"; echo "{$sxml->num} / {$sxml->den} = {$ans}\n"; // Output: 20.5 / 1 = 20
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QmrVH
function name:  (null)
number of ops:  19
compiled vars:  !0 = $sxml, !1 = $ans
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'simplexml_load_string'
          1        SEND_VAL                                                 '%3Ctest%3E%3Cnum%3E20.5%3C%2Fnum%3E%3Cden%3E1%3C%2Fden%3E%3C%2Ftest%3E'
          2        DO_ICALL                                         $2      
          3        ASSIGN                                                   !0, $2
    5     4        FETCH_OBJ_R                                      ~4      !0, 'num'
          5        FETCH_OBJ_R                                      ~5      !0, 'den'
          6        DIV                                              ~6      ~4, ~5
          7        ASSIGN                                                   !1, ~6
    7     8        ECHO                                                     'XML+Test%3A%0A'
    8     9        FETCH_OBJ_R                                      ~8      !0, 'num'
         10        ROPE_INIT                                     6  ~11     ~8
         11        ROPE_ADD                                      1  ~11     ~11, '+%2F+'
         12        FETCH_OBJ_R                                      ~9      !0, 'den'
         13        ROPE_ADD                                      2  ~11     ~11, ~9
         14        ROPE_ADD                                      3  ~11     ~11, '+%3D+'
         15        ROPE_ADD                                      4  ~11     ~11, !1
         16        ROPE_END                                      5  ~10     ~11, '%0A'
         17        ECHO                                                     ~10
    9    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.52 ms | 1399 KiB | 15 Q