3v4l.org

run code in 500+ PHP versions simultaneously
<?php $post = (object)['content' => '<style>some random css</style>the text I really want']; $doc = new DOMDocument(); $doc->loadHTML($post->content); echo $doc->getElementsByTagName('body')->item(0)->nodeValue . "\n"; echo preg_replace('#<style>.*?</style>#', '', $post->content);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GamSK
function name:  (null)
number of ops:  24
compiled vars:  !0 = $post, !1 = $doc
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   CAST                                              8  ~2      <array>
          1        ASSIGN                                                       !0, ~2
    4     2        NEW                                                  $4      'DOMDocument'
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !1, $4
    5     5        INIT_METHOD_CALL                                             !1, 'loadHTML'
          6        CHECK_FUNC_ARG                                               
          7        FETCH_OBJ_FUNC_ARG                                   $7      !0, 'content'
          8        SEND_FUNC_ARG                                                $7
          9        DO_FCALL                                          0          
    6    10        INIT_METHOD_CALL                                             !1, 'getElementsByTagName'
         11        SEND_VAL_EX                                                  'body'
         12        DO_FCALL                                          0  $9      
         13        INIT_METHOD_CALL                                             $9, 'item'
         14        SEND_VAL_EX                                                  0
         15        DO_FCALL                                          0  $10     
         16        FETCH_OBJ_R                                          ~11     $10, 'nodeValue'
         17        CONCAT                                               ~12     ~11, '%0A'
         18        ECHO                                                         ~12
    7    19        FETCH_OBJ_R                                          ~13     !0, 'content'
         20        FRAMELESS_ICALL_3                preg_replace        ~14     '%23%3Cstyle%3E.%2A%3F%3C%2Fstyle%3E%23', ''
         21        OP_DATA                                                      ~13
         22        ECHO                                                         ~14
         23      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.1 ms | 2534 KiB | 13 Q