2017-25 © Pedro Peláez
 

project php54-arrays

Command-line script to convert between array() and PHP 5.4's short syntax []

image

dg/php54-arrays

Command-line script to convert between array() and PHP 5.4's short syntax []

  • Monday, March 26, 2018
  • by david@grudl.com
  • Repository
  • 10 Watchers
  • 39 Stars
  • 172 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

PHP 5.4 Short Arrays Converter []

Command-line script to convert between array() and PHP 5.4's short syntax [] (and vice versa)., (*1)

It uses native PHP tokenizer, so conversion is safe. The script was successfully tested against thousands of PHP files., (*2)

Usage

To convert all *.php and *.phpt files in whole directory recursively or to convert a single file use:, (*3)

php convert.php <directory | file>

To convert source code from STDIN and print the output to STDOUT use:, (*4)

php convert.php < input.php > output.php

To convert short syntax [] to older long syntax array() use option --reverse:, (*5)

php convert.php --reverse <directory | file>

The Versions

26/03 2018

dev-master

9999999-dev

Command-line script to convert between array() and PHP 5.4's short syntax []

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0

 

26/05 2015

v3

3.0.0.0

Command-line script to convert between array() and PHP 5.4's short syntax []

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0

 

15/08 2014

v2

2.0.0.0

Command-line script to convert between array() and PHP 5.4's short syntax []

  Sources   Download

BSD-3-Clause

14/08 2014

v1

1.0.0.0

Command-line script to convert array() to PHP 5.4's short syntax []

  Sources   Download

BSD-3-Clause