Code Monkey home page Code Monkey logo

php7-strict-types-testing's Introduction

php7-strict-types-testing

Testing the new behaviour of strict type hints

In order to test my article published in dzone.

Requirements:

The vagrant machine provisions PHP7 compiler and libraries needed for that.

In the event that you want to install manually in an ubuntu fresh installation:

git clone https://github.com/jlaso/php7-strict-types-testing.git

cd php7-strict-types-testing

vagrant up

This is to create a link between our ssh keys into the vagrant machine:

ssh-add ~/.ssh/id_rsa

once vagrant machine provisioned to enter into the machine:

vagrant ssh

first update the system and install needed packages:

sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install openssl libssl-dev openssl-blacklist openssl-blacklist-extra  bison autoconf automake libtool re2c flex 
sudo apt-get install libxml2-dev libssl-dev libbz2-dev libcurl3-dev libdb5.1-dev libjpeg-dev libpng-dev libXpm-dev libfreetype6-dev libt1-dev libgmp3-dev libc-client-dev libldap2-dev libmcrypt-dev libmhash-dev freetds-dev libz-dev libmysqlclient15-dev ncurses-dev libpcre3-dev unixODBC-dev libsqlite-dev libaspell-dev libreadline6-dev librecode-dev libsnmp-dev libtidy-dev libxslt-dev libt1-dev

in order to install php from sources you need to clone the repo (be patient):

git clone https://github.com/php/php-src.git
cd php-src/

and now, following the official documentation:

./buildconf
./configure
make
sudo make install

check now if the version installed matches:

php -v

if not apears the expected version, you have to repeat the steps changing firstly to the branch you want.

In order to pass the tests you need to install PHPUnit. Following the official documentation:

wget https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
sudo mv phpunit.phar /usr/local/bin/phpunit

See the rest of the samples to check how to use the new strict types checking.

Inside the machine, sample code is located at /var/www/source.

php7-strict-types-testing's People

Contributors

jlaso avatar

Watchers

Roberto Luna Rojas avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.