- Set up GitHub account + add your SSH keys
- Fork php-src repo to your GitHub account
- Clone source (or use USB stick) & cd into directory
- Update origin remote URL with your fork
$ git remote set-url origin {your-fork-URL}
$ git remote set-url origin {your-fork-URL}
<?php | |
class Color | |
{ | |
private $hex; | |
private $r; | |
private $g; | |
private $b; | |
public function __construct(string $hex) { |
When upgrading to PHP 7, you might run into really hard-to-debug error messages which might be a result of the uniform variable syntax RFC.
This script (forked from Nikita Popov's gist) will scan a PHP 5 codebase and call out the file and line number of an indirect expression with an offset. The evaluation of these expressions has changed in PHP 7.
To run this script against a PHP 5 codebase, make sure you have PHP and Composer installed. Then create a directory somewhere and install nikic/php-parser
with Composer.
<?php | |
// Similar, but not quite the same as LeetCode problem #226 | |
// @see https://leetcode.com/problems/invert-binary-tree/description/ | |
function invertTree(array $nodes): array | |
{ | |
$height = (int) floor(log(count($nodes), 2)); | |
$level = 1; | |
while ($level <= $height) { | |
$start = 2 ** $level - 1; |