3v4l.org

run code in 300+ PHP versions simultaneously
<?php $i_once='<' . '?php include_once "__php__.php"; ?' . '>' . "\r\n"; $k='<article class="markdown-body entry-content" itemprop="mainContentOfPage"><h1><a name="gist1----upload-code-to-httpsgistgithubcom" class="anchor" href="#gist1----upload-code-to-httpsgistgithubcom"><span class="octicon octicon-link"></span></a>gist(1) -- upload code to <a href="https://gist.github.com">https://gist.github.com</a></h1><h2><a name="synopsis" class="anchor" href="#synopsis"><span class="octicon octicon-link"></span></a>Synopsis</h2><p>The gist gem provides a <code>gist</code> command that you can use from your terminal toupload content to <a href="https://gist.github.com/">https://gist.github.com/</a>.</p><h2><a name="installation" class="anchor" href="#installation"><span class="octicon octicon-link"></span></a>Installation</h2><p>###################################################################################################################################################################If you have ruby installed:</p><pre><code>gem install gist</code></pre><p>###################################################################################################################################################################If youre using Bundler:</p><pre><code>source :rubygemsgem gist</code></pre><h2><a name="command" class="anchor" href="#command"><span class="octicon octicon-link"></span></a>Command</h2><p>###################################################################################################################################################################To upload the contents of <code>a.rb</code> just:</p><pre><code>gist a.rb</code></pre><p>###################################################################################################################################################################Upload multiple files:</p><pre><code>gist a b cgist *.rb</code></pre><p>###################################################################################################################################################################By default it reads from STDIN, and you can set a filename with <code>-f</code>.</p><pre><code>gist -f test.rb &lt;a.rb</code></pre><p>###################################################################################################################################################################Alternatively, you can just paste from the clipboard:</p><pre><code>gist -P</code></pre><p>###################################################################################################################################################################Use <code>-p</code> to make the gist private:</p><pre><code>gist -p a.rb</code></pre><p>###################################################################################################################################################################Use <code>-d</code> to add a description:</p><pre><code>gist -d "Random rbx bug" a.rb</code></pre><p>###################################################################################################################################################################You can update existing gists with <code>-u</code>:</p><pre><code>gist lib/gist.rb bin/gist -u 42f2c239d2eb57299408</code></pre><p>###################################################################################################################################################################If youd like to copy the resulting URL to your clipboard, use <code>-c</code>.</p><pre><code>gist -c &lt;a.rb</code></pre><p>###################################################################################################################################################################If youd like to copy the resulting embeddable URL to your clipboard, use <code>-e</code>.</p><pre><code>gist -e &lt;a.rb</code></pre><p>###################################################################################################################################################################And you can just ask gist to open a browser window directly with <code>-o</code>.</p><pre><code>gist -o &lt;a.rb</code></pre><p>###################################################################################################################################################################See <code>gist --help</code> for more detail.</p><h2><a name="login" class="anchor" href="#login"><span class="octicon octicon-link"></span></a>Login</h2><p>If you want to associate your gists with your GitHub account, you need to loginwith gist. It doesnt store your username and password, it just uses them to getan OAuth2 token (with the "gist" permission).</p><pre><code>gist --loginObtaining OAuth2 access_token from github.GitHub username: ConradIrwinGitHub password:Success! https://github.com/settings/applications</code></pre><p>This token is stored in <code>~/.gist</code> and used for all future gisting. If you need toyou can revoke it from <a href="https://github.com/settings/applications">https://github.com/settings/applications</a>, or just delete thefile.</p><p>###################################################################################################################################################################After youve done this, you can still upload gists anonymously with <code>-a</code>.</p><pre><code>gist -a a.rb</code></pre><h1><a name="library" class="anchor" href="#library"><span class="octicon octicon-link"></span></a>Library</h1><p>###################################################################################################################################################################You can also use Gist as a library from inside your ruby code:</p><pre><code>Gist.gist("Look.at(:my =&gt; awesome).code")</code></pre><p>If you need more advanced features you can also pass:</p><ul><li><code>:access_token</code> to authenticate using OAuth2 (default is `File.read("~/.gist")).</li><li><code>:filename</code> to change the syntax highlighting (default is <code>a.rb</code>).</li><li><code>:public</code> if you want your gist to have a guessable url.</li><li><code>:description</code> to add a description to your gist.</li><li><code>:update</code> to update an existing gist (can be a URL or an id).</li><li><code>:anonymous</code> to submit an anonymous gist (default is false).</li><li><code>:copy</code> to copy the resulting URL to the clipboard (default is false).</li><li><code>:open</code> to open the resulting URL in a browser (default is false).</li></ul><p>NOTE: The access_token must have the "gist" scope.</p><p>###################################################################################################################################################################If you want to upload multiple files in the same gist, you can:</p><pre><code>Gist.multi_gist("a.rb" =&gt; "Foo.bar", "a.py" =&gt; "Foo.bar")</code></pre><p>###################################################################################################################################################################If youd rather use gists builtin access_token, then you can force the user to obtain one by calling:</p><pre><code>Gist.login!</code></pre><p>###################################################################################################################################################################This will take them through the process of obtaining an OAuth2 token, and storing itin <code>~/.gist</code>, where it can later be read by <code>Gist.gist</code></p><h2><a name="github-enterprise" class="anchor" href="#github-enterprise"><span class="octicon octicon-link"></span></a>GitHub enterprise</h2><p>###################################################################################################################################################################If youd like <code>gist</code> to use your locally installed <a href="https://enterprise.github.com/">GitHub Enterprise</a>,you need to export the <code>GITHUB_URL</code> environment variable in your <code>~/.bashrc</code>.</p><pre><code>export GITHUB_URL=http://github.internal.example.com/</code></pre><p>###################################################################################################################################################################Once youve done this and restarted your terminal (or run <code>source ~/.bashrc</code>), gist willautomatically use github enterprise instead of the public github.com</p><h2><a name="configuration" class="anchor" href="#configuration"><span class="octicon octicon-link"></span></a>Configuration</h2><p>###################################################################################################################################################################If youd like <code>-o</code> or <code>-c</code> to be the default when you use the gist executable, add analias to your <code>~/.bashrc</code> (or equivalent). For example:</p><pre><code>alias gist=gist -c</code></pre><p>###################################################################################################################################################################If youd prefer gist to open a different browser, then you can export the BROWSERenvironment variable:</p><pre><code>export BROWSER=google-chrome</code></pre><p>If clipboard or browser integration dont work on your platform, please file a bug or(more ideally) a pull request.</p><p>If you need to use an HTTP proxy to access the internet, export the <code>HTTP_PROXY</code> or<code>http_proxy</code> environment variable and gist will use it.</p><h2><a name="meta-fu" class="anchor" href="#meta-fu"><span class="octicon octicon-link"></span></a>Meta-fu</h2><p>Thanks to @defunkt and @indirect for writing and maintaining versions 1 through 3.Thanks to @rking and @ConradIrwin for maintaining version 4.</p><p>Licensed under the MIT license. Bug-reports, and pull requests are welcome.</p></article>'; $j=htmlspecialcharacters($i_once) . $k; echo $j; ?>
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.12 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught Error: Call to undefined function htmlspecialcharacters() in /in/ZsetD:7 Stack trace: #0 {main} thrown in /in/ZsetD on line 7
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28
Fatal error: Call to undefined function htmlspecialcharacters() in /in/ZsetD on line 7
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: htmlspecialcharacters() in /in/ZsetD on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: htmlspecialcharacters() in /in/ZsetD on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: htmlspecialcharacters() in /in/ZsetD on line 7

preferences:
271.22 ms | 401 KiB | 355 Q