3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @author lolkittens * @copyright 2016 */ echo "<!DOCTYPE html> <html> <head> <meta charset='utf-8'> <title>TODO.todo</title></head> <body> <style> .project { line-height: 4px; } .bullet-done { font-weight: bold; font-style: normal; color: rgba(0,114,62,1.0); } .note{ display: block; color: rgba(133,130,102,1.0); font-weight: normal; font-style: normal; } .todo { display: inline-block; } .tag { font-weight: bold; font-style: normal; color: rgba(160,46,43,0.6); } body { background: rgba(239,233,183,1.0); color: rgba(0,0,0,0.31); font-weight: normal; font-style: normal; } h1 { font-weight: bold; font-style: normal; background: rgba(0,0,0,0.06); color: rgba(188,100,74,1.0); width: 100%; line-height: 34px; } .tab{ display: inline-block; width:0px; height: 0px; background: #000000; </style><pre>"; $todo = 'Version 1: This file is in TaskPaper format. Tabs are used to indent. Each task begins with a "- ". Projects end with a ":". Tags are in the format "@tag_name". All other lines (such as these) are considered as notes, and are to be ignored. - User signup - Register for an account - Log in @done - Forget password - Manage users - Create users @in_progress - Delete users - User profile page @40% - Blog - Creating new posts @done - Comments @done - Moderating comments @done This is my todo list: This is a note about the list. - this is an item @done - and this is @me this is a note about my done item - this is the last @java @shopping @item @done This is a second list: - Add more funk to something @work @java - Send something somewhere @work @email @due(12 Aug 07) - this is an example - dfgdfg ggg hfghf - hgh - dfygdfgdf List: - gdfgdf `inline code` hhf - gdfgdf - dfgdfg @done '; echo get_marked_up_todo($todo); echo '</pre></body></html>'; function get_marked_up_todo($todo){ $todo = htmlspecialchars($todo,ENT_QUOTES)."\n\n"; $search = array('/(.+:)(.+)\n\n/sU', // Get projects '/(- ([^\@\n]+).+)/', // Get todos '/(.+:)/', // Get headings '/\n([^\<\n].+)/', // Get notes '/- (.+@done)/', // Get done '/(@due\([^\)]+\))/', // Get due tags '/(@(?!due)[^\s]+)/', // Get tags "/\t/", '/`(.*?)`/', // inline code ); $replace = array("<div class=\"project\">\n$1$2\n</div>\n\n", '<span class="todo"><input type="checkbox" value="'.trim('\2').'"> \1</span>', '<h1>\1</h1>', "\n\t<span class=\"note\">$1</span>", '<span class="bullet-done">? ? ??</span> - <strike>\1</strike>', '<span class="tag due">\1</span>', '<span class="tag">\1</span>', "\t<span class=\"tab\"></span>", '<code>\1</code>', ); return preg_replace($search, $replace, $todo); } ?>

Abusive script

This script was stopped while abusing our resources

Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/f0e8W
function name:  (null)
number of ops:  8
compiled vars:  !0 = $todo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ECHO                                                     '%3C%21DOCTYPE+html%3E%0A%3Chtml%3E%0A%3Chead%3E%0A%3Cmeta+charset%3D%27utf-8%27%3E%0A%3Ctitle%3ETODO.todo%3C%2Ftitle%3E%3C%2Fhead%3E%0A%3Cbody%3E%0A%3Cstyle%3E%0A.project+%7B%0A++++line-height%3A+4px%3B%0A%7D%0A.bullet-done+%7B%0A++++font-weight%3A+bold%3B%0A++++font-style%3A+normal%3B%0A++++color%3A+rgba%280%2C114%2C62%2C1.0%29%3B%0A%7D%0A.note%7B%0Adisplay%3A+block%3B%0Acolor%3A+rgba%28133%2C130%2C102%2C1.0%29%3B%0Afont-weight%3A+normal%3B%0Afont-style%3A+normal%3B%0A%7D%0A.todo+%7B%0A++++display%3A+inline-block%3B%0A%7D%0A.tag+%7B%0A++++font-weight%3A+bold%3B%0A++++font-style%3A+normal%3B%0A++++color%3A+rgba%28160%2C46%2C43%2C0.6%29%3B%0A%7D%0Abody+%7B%0A++++background%3A+rgba%28239%2C233%2C183%2C1.0%29%3B%0A++++color%3A+rgba%280%2C0%2C0%2C0.31%29%3B%0A++++font-weight%3A+normal%3B%0A++++font-style%3A+normal%3B%0A%7D%0Ah1+%7B%0A++++font-weight%3A+bold%3B%0A++++font-style%3A+normal%3B%0A++++background%3A+rgba%280%2C0%2C0%2C0.06%29%3B%0A++++color%3A+rgba%28188%2C100%2C74%2C1.0%29%3B%0A++++width%3A+100%25%3B%0A++++line-height%3A+34px%3B%0A%7D%0A.tab%7B%0A++++display%3A+inline-block%3B%0A++++width%3A0px%3B%0A++++height%3A+0px%3B%0A++++background%3A+%23000000%3B%0A%3C%2Fstyle%3E%3Cpre%3E'
   55     1        ASSIGN                                                   !0, 'Version+1%3A%0AThis+file+is+in+TaskPaper+format.%0ATabs+are+used+to+indent.%0A++++Each+task+begins+with+a+%22-+%22.%0AProjects+end+with+a+%22%3A%22.%0ATags+are+in+the+format+%22%40tag_name%22.%0AAll+other+lines+%28such+as+these%29+are+considered+as+notes%2C%0Aand+are+to+be+ignored.%0A%0A-+User+signup%0A-+Register+for+an+account%0A++++-+Log+in+%40done%0A++++-+Forget+password%0A%0A-+Manage+users%0A++++-+Create+users+%40in_progress%0A++++-+Delete+users%0A++++-+User+profile+page+%4040%25%0A%0A-+Blog%0A++++-+Creating+new+posts+%40done%0A++++-+Comments+%40done%0A++++-+Moderating+comments+%40done%0A++++++++%0AThis+is+my+todo+list%3A%0A%09This+is+a+note+about+the+list.%0A++++-+this+is+an+item++%40done%0A++++-+and+this+is+%40me+%0Athis+is+a+note+about+my+done+item%0A++-+this+is+the+last+%40java+%40shopping+%40item+%40done%0A%0AThis+is+a+second+list%3A%0A-+Add+more+funk+to+something+%40work+%40java+%0A++++-+Send+something+somewhere+%40work+%40email+%40due%2812+Aug+07%29%0A++++++++-+this+is+an+example%0A-+dfgdfg%0Aggg%0Ahfghf++%0A-+hgh%0A-+dfygdfgdf%0A%0AList%3A%0A-+gdfgdf+%60inline+code%60+hhf%0A-+gdfgdf%0A-+dfgdfg+%40done%0A++++++++'
  102     2        INIT_FCALL_BY_NAME                                       'get_marked_up_todo'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
  104     6        ECHO                                                     '%3C%2Fpre%3E%3C%2Fbody%3E%3C%2Fhtml%3E'
  130     7      > RETURN                                                   1

Function get_marked_up_todo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/f0e8W
function name:  get_marked_up_todo
number of ops:  30
compiled vars:  !0 = $todo, !1 = $search, !2 = $replace
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  106     0  E >   RECV                                             !0      
  107     1        INIT_FCALL                                               'htmlspecialchars'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 3
          4        DO_ICALL                                         $3      
          5        CONCAT                                           ~4      $3, '%0A%0A'
          6        ASSIGN                                                   !0, ~4
  108     7        ASSIGN                                                   !1, <array>
  118     8        INIT_ARRAY                                       ~7      '%3Cdiv+class%3D%22project%22%3E%0A%241%242%0A%3C%2Fdiv%3E%0A%0A'
  119     9        INIT_FCALL                                               'trim'
         10        SEND_VAL                                                 '%5C2'
         11        DO_ICALL                                         $8      
         12        CONCAT                                           ~9      '%3Cspan+class%3D%22todo%22%3E%3Cinput+type%3D%22checkbox%22+value%3D%22', $8
         13        CONCAT                                           ~10     ~9, '%22%3E+%5C1%3C%2Fspan%3E'
         14        ADD_ARRAY_ELEMENT                                ~7      ~10
  120    15        ADD_ARRAY_ELEMENT                                ~7      '%3Ch1%3E%5C1%3C%2Fh1%3E'
  121    16        ADD_ARRAY_ELEMENT                                ~7      '%0A%09%3Cspan+class%3D%22note%22%3E%241%3C%2Fspan%3E'
  122    17        ADD_ARRAY_ELEMENT                                ~7      '%3Cspan+class%3D%22bullet-done%22%3E%3F+%3F+%3F%3F%3C%2Fspan%3E+-+%3Cstrike%3E%5C1%3C%2Fstrike%3E'
  123    18        ADD_ARRAY_ELEMENT                                ~7      '%3Cspan+class%3D%22tag+due%22%3E%5C1%3C%2Fspan%3E'
  124    19        ADD_ARRAY_ELEMENT                                ~7      '%3Cspan+class%3D%22tag%22%3E%5C1%3C%2Fspan%3E'
  125    20        ADD_ARRAY_ELEMENT                                ~7      '%09%3Cspan+class%3D%22tab%22%3E%3C%2Fspan%3E'
  126    21        ADD_ARRAY_ELEMENT                                ~7      '%3Ccode%3E%5C1%3C%2Fcode%3E'
  118    22        ASSIGN                                                   !2, ~7
  128    23        INIT_FCALL                                               'preg_replace'
         24        SEND_VAR                                                 !1
         25        SEND_VAR                                                 !2
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                         $12     
         28      > RETURN                                                   $12
  129    29*     > RETURN                                                   null

End of function get_marked_up_todo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.1 ms | 1007 KiB | 16 Q