• Stars
    star
    120
  • Rank 295,983 (Top 6 %)
  • Language
    HTML
  • License
    GNU General Publi...
  • Created over 11 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Extended version of the Blueshoes PHP cheat sheet for variable type juggling

PHP-cheat-sheet-extended

GitHub license Build Status Scrutinizer Code Quality

View these cheat sheets live at PHPCheatsheets.com

Much extended version of the Blueshoes PHP cheat sheet for variable type juggling.

Features:

  • Lots of extra variables being tested.
  • Lots of extra comparisons and tests.
  • Variable arithmetic.
  • Results available for a wide variety of PHP versions.

Contributing:

Suggestions for additional test variables, additional comparisons, tests or other improvements are very welcome. Just open an issue or send in a pull request for it.

About the static versions of the sheets:

Static versions of the cheatsheets are generated using a variety of PHP versions.

These PHP versions will include:

  • [Always] Latest release for each minor PHP version at the time of (re-)generation of the static sheets.
  • [Always] The PHP versions included in the last three Ubuntu, Debian and CentOS LTS releases.
  • [Selectively] Popular minor releases based on worldwide usage statistics at the time of (re-)generation of the static sheets.
  • [Selectively] Previously included versions if no other close minor release will be included.

In general, a balance is sought between significance and variety.

Credits:

Changelog:

1.4.0 (April 9 2019): PHP 7.3 and more

  • New tests:
    • is_iterable() in variable tests (PHP 7.1+ only).
    • is_countable() in variable tests (PHP 7.3+ only).
    • version_compare() in variable comparisons.
  • Renewed static sheets:
    • Added static sheets for PHP 7.3.4, 7.3.0, 7.2.17, 7.2.13, 7.2.6, 7.2.3, 7.1.28, 7.1.18, 7.1.5, 7.0.33, 7.0.27, 5.6.40, 5.6.30
    • Removed static sheet generation for PHP 7.2.0, 7.1.12, 7.1.7, 7.1.0, 7.0.26, 7.0.21, 7.0.14, 5.6.32, 5.6.29, 5.6.25, 5.5.16, 5.4.41, 5.3.27, 5.2.6, 5.0.4
  • Updated CastToType submodule to v 2.0.1.
  • Account for Exception text changes in PHP 7.3.
  • Bugfix: arrays and objects are now reset before each test.

Also:

  • The website is now available over SSL.
  • Minor language fixes.
  • Updated the code for the social media and donate buttons.
  • Removed the tablesorting feature from the sitemap.xml file.
  • Minor tweaks to the Travis tests.
  • General housekeeping/CS fixes.

Note: This will be the last version with support for PHP < 5.4.

1.3.8 (November 30 2017): PHP 7.2 has landed

  • Renewed static sheets:
    • Added static sheets for PHP 7.2.0, 7.1.12, 7.0.26, 5.6.32, 5.6.29, 5.6.21
    • Removed static sheet generation for PHP 7.2.0-beta1, 7.1.3, 7.0.17, 5.6.31, 5.6.28, 5.6.20, 5.5.35, 5.4.36

1.3.7 (July 26 2017): PHP 7.2 beta 1 release

  • Renewed static sheets:
    • Added static sheets for PHP 7.2.0-beta1, 7.1.7, 7.0.21, 7.0.19, 7.0,14, 5.6.31
    • Removed static sheet generation for PHP 7.0.12, 7.0.0, 5.6.30, 5.6.0, 5.2.9-2.

1.3.6 (March 23 2017)

  • Renewed static sheets:
    • Added static sheets for PHP 7.1.3, 7.0.17, 7.0,12, 5.6.30
    • Removed static sheet generation for PHP 7.0.13, 7.0.10.

1.3.5 (Dec 3 2016): PHP 7.1 has been released: new arithmetic exceptions

  • Renewed static sheets:
    • Added static sheets for PHP 7.1.0, 7.0.13, 7.0.10, 5.6.28, 5.6.25, 5.5.38, 5.5.35.
    • Removed static sheet generation for PHP 7.1.0-alpha3, 7.0.8, 7.0.6, 5.6.23, 5.6.13, 5.5.37, 5.5.33, 5.5.3.
  • The cheatsheets for PHP 4 are no longer actively maintained (regenerated) except for the version switcher menu.

1.3.4 (Jul 9 2016): What will PHP 7.1 bring ?

  • Renewed static sheets:
    • Added static sheets for PHP 7.1.0-alpha3, 7.0.8, 7.0.6, 5.6.23, 5.6.20, 5.6.16, 5.5.37
    • Removed static sheet generation for PHP 7.0.2, 5.6.19, 5.6.17, 5.6.15, 5.6.9, 5.5.28, 5.3.2.

1.3.3 (Mar 11 2016)

  • Renewed static sheets:
    • Added static sheets for PHP 7.0.4, 7.0.2, 5.6.19, 5.6.17, 5.5.33, 5.5.22.
    • Removed static sheet generation for PHP 5.6.11, 5.5.26, 5.5.21, 5.4.43, 5.4.39.

1.3.2 (Dec 3 2015): PHP 7 is here!

  • Renewed static sheets:
    • Added static sheets for PHP 7.0.0.
    • Removed static sheet generation for PHP 7.0.0-RC6.
  • Fixed static sheets to display the correct 'live' version (moved to server running PHP 5.6.8 - was 5.4.13).

1.3.1 (Nov 2015): PHP 7 is nearly upon us!

  • Renewed static sheets based on currently available and most used versions:
    • Added static sheets for PHP 7.0.0-RC6, 5.6.15, 5.6.13, 5.6.11, 5.6.9, 5.6.7, 5.5.30, 5.5.28, 5.5.21, 5.4.45, 5.4.27, 5.4.41, 5.4.43.
    • Removed static sheet generation for PHP 7.0.0-alpha1, 5.6.10, 5.6.8, 5.6.5, 5.6.2, 5.5.24, 5.5.22, 5.4.42, 5.4.33, 5.4.20, 5.4.11.
  • Fixed "division by zero" error catching for PHP7 as the Exception hierarchy changed in PHP7-alpha2.
  • Some other minor improvements.

1.3 (Jun 2015): Get ready for PHP 7!

  • New tests:
    • <=> in variable comparisons (PHP7+ only).
    • $x ?? ... in variable tests (PHP7+ only).
    • intdiv() in variable arithmetics (PHP7+ only).
    • preg_match() with unicode property codes in variable string tests (PHP5.1+).
  • Added two new variables specifically for the unicode property tests.
  • Renewed static sheets based on currently available and most used versions:
    • Added static sheets for PHP 7.0.0-alpha1, 5.6.10, 5.6.8, 5.6.0, 5.5.26, 5.5.24, 5.5.22, 5.4.42, 5.4.39, 5.4.36.
    • Removed static sheet generation for PHP 5.6.4, 5.5.21, 5.5.20, 5.5.18, 5.4.37, 5.4.35 and 4.3.9.
  • Updated CastToType submodule to v2.0 which brings object casting via that class for all PHP versions in line with PHP7 and fixes a bug in object casting for PHP <= 5.1.

Also:

  • Fixed a hiccup where the "Filter" tab would be shown in PHP 5.1, while the filter extension is only available in PHP 5.2+.
  • Fixed a bug on the "test" cheatsheet where the row variable header would not display properly in the right hand column on low PHP versions.
  • Improved grouping of PHP error messages.
  • Added some more user facing information about the tests run and version quirks.
  • Fixed js error in sitemap stylesheet.
  • Fixed a faulty redirect in .htaccess.
  • Minor UI improvements.
  • Tidying up.

1.2.0.1 (Feb 2015)

  • Added sitemaps.

1.2 (Feb 2015)

  • New tests:
    • pow() in variable arithmetic.
    • ** (PHP 5.6+) in variable arithmetic.
    • . (concatenation) in variable arithmetic - for want of better place.
  • Added two new float variables.
  • Lots of usability improvements:
    • Select PHP version via dropdown.
    • PHP version persists across sheets.
    • Variable legend now auto-expand when user clicks on variable 'footnote' link.
    • 'Pretty' (semantic) urls.
    • Better window titles.
    • Better error handling (404).
  • Static sheets now available in lots more versions (30!), including PHP 5.5, 5.6 which weren't available until now. Retired some older versions which have close versions available anyhow.
  • Fixed:
    • Variable legend for binary integer was missing.

Also:

  • Added donate to charity button.
  • Change over to absolute rather than relative urls.
  • Minor html and css fixes.
  • Script to autogen (nearly) all static sheets.
  • Updated cast-to-type submodule.
  • Upgraded jQuery and jQuery UI to 1.11.2.
  • General tidying up.

1.1 (Feb 2014) - move to own domain.

  • New tests:
    • abs() in variable testing.
  • New pages:
    • 'other cheatsheets'.
    • 'about'.
  • New site styling for own domain.

Also:

  • Added twitter & LinkedIn share buttons.
  • Upgraded jQuery to 1.11.0 and jQuery UI to v 1.10.4.
  • Cleaned up HTML.

1.0 (Sep 2013) - first public version.

More Repositories

1

make-phpcs-work-for-you

Demo code for the "Don't work for PHPCS, make PHPCS work for you" talk
XSLT
28
star
2

QA-WP-Projects

Example code for talk about how to use a variety of PHPCS rules and standards to get an indication of code quality for WP plugins and themes
PHP
18
star
3

wp-hook-documentor

Application to document action and filters hook in WordPress plugins
PHP
14
star
4

PHP-cast-to-type

PHP Class to easily cast variables to a specific type.
PHP
12
star
5

wp-plugin-best-practices-demo

Demo for WP Plugin development best practices tutorial
PHP
9
star
6

Google-WebDev-PHPCS

A set of PHP Codesniffer rules which can be used to check for best practices and performance issues with special focus on optimization for Google AMP.
4
star
7

top-10-phpunit-tips-tricks-demo

PHP
3
star
8

Debug-Bar-Taxonomies

Extension to the WP Debug Bar Plugin showing the registered taxonomies for your site
PHP
3
star
9

debug-bar-pretty-output

Helper class for WordPress Debug Bar plugins
PHP
2
star
10

debug-bar-localization

Extension to the WP Debug Bar Plugin showing information on localization calls made.
PHP
2
star
11

wp-known-plugin-dependencies

Add-on plugin for the WordPress Plugin Dependencies plugin, injecting additional information about known dependencies between plugins.
PHP
2
star
12

phpcs-plugin-test-134

1
star
13

WP-adminbar-no-customizer

Moves the Customizer link from the Adminbar top level to be a subitem under the site-menu.
PHP
1
star
14

cmb2-yoast-seo-bridge

1
star
15

wordpress-plugins-tutorial

Shell
1
star
16

debug-bar-plugin-activation

Extension to the WP Debug Bar Plugin showing the plugin (de-)activation errors.
PHP
1
star
17

Debug-Bar-Shortcodes

Extension to the WP Debug Bar Plugin showing the registered shortcodes on a page request
PHP
1
star
18

Debug-Bar-Constants

Extension to the WP Debug Bar Plugin showing the constants available on a page request
PHP
1
star
19

Debug-Bar-Post-Types

Extension to the WP Debug Bar Plugin showing the registered post types for your site
PHP
1
star