Skip to content

Instantly share code, notes, and snippets.

View timwhitlock's full-sized avatar

Tim Whitlock timwhitlock

View GitHub Profile
@timwhitlock
timwhitlock / convert_array_access_braces.php
Last active September 30, 2020 10:55 — forked from theodorejb/convert_array_access_braces.php
Migrate deprecated curly brace array access syntax to bracket syntax. Requires PHP 7.4.
<?php
error_reporting(E_ALL);
$opts = getopt('f:d:rb:', ['ext:', 'php:', 'diff::']);
if ((int)isset($opts['d']) + (int)isset($opts['f']) !== 1) {
$self = basename(__FILE__);
echo <<<EOF
Usage:
php $self -f<php_script> [-b] [--php <path_to_php>] [ --diff [<file>]]