3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getdata() { $contents = "<table><tr><td>Row 1 Column 1</td><td>Row 1 Column 2</td></tr><tr><td>Row 2 Column 1</td><td>Row 2 Column 2</td></tr></table>"; $DOM = new DOMDocument; $DOM->loadHTML($contents); $items = $DOM->getElementsByTagName('tr'); function tdrows($elements) { $str = ""; foreach ($elements as $element) { $str .= $element->nodeValue . ", "; } return $str; } foreach ($items as $node) { echo tdrows($node->childNodes) . "<br />"; } } getdata();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MQ2rt
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_FCALL                                               'getdata'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function getdata:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 22
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 22
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/MQ2rt
function name:  getdata
number of ops:  24
compiled vars:  !0 = $contents, !1 = $DOM, !2 = $items, !3 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, '%3Ctable%3E%3Ctr%3E%3Ctd%3ERow+1+Column+1%3C%2Ftd%3E%3Ctd%3ERow+1+Column+2%3C%2Ftd%3E%3C%2Ftr%3E%3Ctr%3E%3Ctd%3ERow+2+Column+1%3C%2Ftd%3E%3Ctd%3ERow+2+Column+2%3C%2Ftd%3E%3C%2Ftr%3E%3C%2Ftable%3E'
    6     1        NEW                                              $5      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
    7     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
    9     7        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
          8        SEND_VAL_EX                                              'tr'
          9        DO_FCALL                                      0  $9      
         10        ASSIGN                                                   !2, $9
   11    11        DECLARE_FUNCTION                                         'tdrows'
   20    12      > FE_RESET_R                                       $11     !2, ->22
         13    > > FE_FETCH_R                                               $11, !3, ->22
   22    14    >   INIT_FCALL_BY_NAME                                       'tdrows'
         15        CHECK_FUNC_ARG                                           
         16        FETCH_OBJ_FUNC_ARG                               $12     !3, 'childNodes'
         17        SEND_FUNC_ARG                                            $12
         18        DO_FCALL                                      0  $13     
         19        CONCAT                                           ~14     $13, '%3Cbr+%2F%3E'
         20        ECHO                                                     ~14
   20    21      > JMP                                                      ->13
         22    >   FE_FREE                                                  $11
   24    23      > RETURN                                                   null

End of function getdata

Function %00tdrows%2Fin%2FMQ2rt%3A11%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/MQ2rt
function name:  tdrows
number of ops:  11
compiled vars:  !0 = $elements, !1 = $str, !2 = $element
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        ASSIGN                                                   !1, ''
   14     2      > FE_RESET_R                                       $4      !0, ->8
          3    > > FE_FETCH_R                                               $4, !2, ->8
   16     4    >   FETCH_OBJ_R                                      ~5      !2, 'nodeValue'
          5        CONCAT                                           ~6      ~5, '%2C+'
          6        ASSIGN_OP                                     8          !1, ~6
   14     7      > JMP                                                      ->3
          8    >   FE_FREE                                                  $4
   18     9      > RETURN                                                   !1
   19    10*     > RETURN                                                   null

End of function %00tdrows%2Fin%2FMQ2rt%3A11%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.03 ms | 1403 KiB | 14 Q