3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_content = '<div><div><iframe width="1280" height="720" src="//www.youtube.com/embed/NKvxWMsGW9E?rel=0" frameborder="0" allowfullscreen></iframe></div></div><div>this div is ok</div>'; $_content = preg_replace('#(?:<(div|span)[^>]*>[\s]*)*(?P<content><iframe[\s]*([^>]+)>[\s]*<\/iframe[^>]*>)(?:[\s]*<(embed|script)[^>]*>[^<]*<\/(embed|script)[^>]*>[\s]*)*(?:<\/(?:div|span)[^>]*>)*#iu', '$content', $_content); echo $_content;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8mW2c
function name:  (null)
number of ops:  9
compiled vars:  !0 = $_content
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cdiv%3E%3Cdiv%3E%3Ciframe+width%3D%221280%22+height%3D%22720%22+src%3D%22%2F%2Fwww.youtube.com%2Fembed%2FNKvxWMsGW9E%3Frel%3D0%22+frameborder%3D%220%22+allowfullscreen%3E%3C%2Fiframe%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3Cdiv%3Ethis+div+is+ok%3C%2Fdiv%3E'
    3     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%23%28%3F%3A%3C%28div%7Cspan%29%5B%5E%3E%5D%2A%3E%5B%5Cs%5D%2A%29%2A%28%3FP%3Ccontent%3E%3Ciframe%5B%5Cs%5D%2A%28%5B%5E%3E%5D%2B%29%3E%5B%5Cs%5D%2A%3C%5C%2Fiframe%5B%5E%3E%5D%2A%3E%29%28%3F%3A%5B%5Cs%5D%2A%3C%28embed%7Cscript%29%5B%5E%3E%5D%2A%3E%5B%5E%3C%5D%2A%3C%5C%2F%28embed%7Cscript%29%5B%5E%3E%5D%2A%3E%5B%5Cs%5D%2A%29%2A%28%3F%3A%3C%5C%2F%28%3F%3Adiv%7Cspan%29%5B%5E%3E%5D%2A%3E%29%2A%23iu'
          3        SEND_VAL                                                 '%24content'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ASSIGN                                                   !0, $2
    4     7        ECHO                                                     !0
          8      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.52 ms | 1394 KiB | 15 Q