3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xsl = <<<EOB <?xml version="1.0" encoding="UTF-8"?> <html xmlns:php="http://php.net/xsl" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0"> <body style="font-family:Arial;font-size:12pt;background-color:#EEEEEE"> <xsl:for-each select="beers/beer"> <div style="background-color:teal;color:white;padding:4px"> <span style="font-weight:bold"> <xsl:value-of select="name"/> </span> <xsl:value-of select="price"/> </div> <div style="margin-left:20px;margin-bottom:1em;font-size:10pt"> <p> <xsl:value-of select="php:functionString('glob', '*.*')"/> <span style="font-style:italic"> ( <xsl:value-of select="prct"/> %) </span> </p> </div> </xsl:for-each> </body> </html> EOB; $xmldoc = DOMDocument::loadXML("http://challenge01.root-me.org/web-serveur/ch50/beers.xml"); $xsldoc = DOMDocument::loadXML($xsl); $proc = new XSLTProcessor(); $proc->registerPHPFunctions(); $proc->importStyleSheet($xsldoc); echo $proc->transformToXML($xmldoc); foreach (glob("*") as $filename) { echo "$filename occupe " . filesize($filename) . "\n"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 25, Position 2 = 35
Branch analysis from position: 25
2 jumps found. (Code = 78) Position 1 = 26, Position 2 = 35
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
filename:       /in/9mj6r
function name:  (null)
number of ops:  37
compiled vars:  !0 = $xsl, !1 = $xmldoc, !2 = $xsldoc, !3 = $proc, !4 = $filename
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%3Chtml+xmlns%3Aphp%3D%22http%3A%2F%2Fphp.net%2Fxsl%22+xmlns%3Axsl%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2FXSL%2FTransform%22+xsl%3Aversion%3D%221.0%22%3E%0A%3Cbody+style%3D%22font-family%3AArial%3Bfont-size%3A12pt%3Bbackground-color%3A%23EEEEEE%22%3E%0A%3Cxsl%3Afor-each+select%3D%22beers%2Fbeer%22%3E%0A%3Cdiv+style%3D%22background-color%3Ateal%3Bcolor%3Awhite%3Bpadding%3A4px%22%3E%0A%3Cspan+style%3D%22font-weight%3Abold%22%3E%0A%3Cxsl%3Avalue-of+select%3D%22name%22%2F%3E%0A%3C%2Fspan%3E%0A%3Cxsl%3Avalue-of+select%3D%22price%22%2F%3E%0A%3C%2Fdiv%3E%0A%3Cdiv+style%3D%22margin-left%3A20px%3Bmargin-bottom%3A1em%3Bfont-size%3A10pt%22%3E%0A%3Cp%3E%0A%3Cxsl%3Avalue-of+select%3D%22php%3AfunctionString%28%27glob%27%2C+%27%2A.%2A%27%29%22%2F%3E%0A%3Cspan+style%3D%22font-style%3Aitalic%22%3E%0A++++%28%0A++++%3Cxsl%3Avalue-of+select%3D%22prct%22%2F%3E%0A++++%25%29%0A%3C%2Fspan%3E%0A%3C%2Fp%3E%0A%3C%2Fdiv%3E%0A%3C%2Fxsl%3Afor-each%3E%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   27     1        INIT_STATIC_METHOD_CALL                                  'DOMDocument', 'loadXML'
          2        SEND_VAL                                                 'http%3A%2F%2Fchallenge01.root-me.org%2Fweb-serveur%2Fch50%2Fbeers.xml'
          3        DO_FCALL                                      0  $6      
          4        ASSIGN                                                   !1, $6
   28     5        INIT_STATIC_METHOD_CALL                                  'DOMDocument', 'loadXML'
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0  $8      
          8        ASSIGN                                                   !2, $8
   30     9        NEW                                              $10     'XSLTProcessor'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !3, $10
   31    12        INIT_METHOD_CALL                                         !3, 'registerPHPFunctions'
         13        DO_FCALL                                      0          
   32    14        INIT_METHOD_CALL                                         !3, 'importStyleSheet'
         15        SEND_VAR_EX                                              !2
         16        DO_FCALL                                      0          
   33    17        INIT_METHOD_CALL                                         !3, 'transformToXML'
         18        SEND_VAR_EX                                              !1
         19        DO_FCALL                                      0  $15     
         20        ECHO                                                     $15
   34    21        INIT_FCALL                                               'glob'
         22        SEND_VAL                                                 '%2A'
         23        DO_ICALL                                         $16     
         24      > FE_RESET_R                                       $17     $16, ->35
         25    > > FE_FETCH_R                                               $17, !4, ->35
   35    26    >   NOP                                                      
         27        FAST_CONCAT                                      ~18     !4, '+occupe+'
         28        INIT_FCALL                                               'filesize'
         29        SEND_VAR                                                 !4
         30        DO_ICALL                                         $19     
         31        CONCAT                                           ~20     ~18, $19
         32        CONCAT                                           ~21     ~20, '%0A'
         33        ECHO                                                     ~21
   34    34      > JMP                                                      ->25
         35    >   FE_FREE                                                  $17
   37    36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
209.28 ms | 1400 KiB | 17 Q