PHP Type Hinting

Video loading...

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:03
    with Leanna Pelham
  • 0:05
    When we submit the form, it goes to battle.php,
  • 0:09
    and we see this nasty error.
  • 0:11
    It comes from functions.php on line 74,
  • 0:15
    and called on battle.php on line 29.
  • 0:20
    Let's start with battle.php.
  • 0:23
    Sure enough, we can see the problem is with the battle() function.
  • 0:27
    Let me show you why.
  • 0:29
    First, let's dump $ship1 and $ship2.
  • 0:36
    Let's see here.

PHP Type Hinting

Loading...

In this lesson, you'll learn how Type Hinting can help you get better errors from PHP as you develop your application. You'll learn to debug errors and see how Type Hinting impacts the phrasing of the error messages you receive.

Downloads: 
Log in or sign up to download companion files.
Additional resources: