php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #72448 Missing $ in echo text
Submitted: 2016-06-18 23:06 UTC Modified: 2016-06-19 15:14 UTC
From: eric at schorvitz dot com Assigned: cmb (profile)
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: eric at schorvitz dot com
New email:
PHP Version: OS:

 

 [2016-06-18 23:06 UTC] eric at schorvitz dot com
Description:
------------
---
From manual page: http://www.php.net/filter.examples.validation
---

<?php
$ip_a = '127.0.0.1';
$ip_b = '42.42';

if (filter_var($ip_a, FILTER_VALIDATE_IP)) {
    echo "This (ip_a) IP address is considered valid.";
}
if (filter_var($ip_b, FILTER_VALIDATE_IP)) {
    echo "This (ip_b) IP address is considered valid.";
}
?>

This (ip_a) should be: This ($ip_a)
This (ip_b) should be: This ($ip_b)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-06-19 15:14 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2016-06-19 15:14 UTC] cmb@php.net
Have a look at the expected output:

| This (ip_a) IP address is considered valid.

That wouldn't match for $ip_a. Of course, the output could be
changed, but what would that be good for? The example already
shows, that the first IP address is considered valid, while the
second is not.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 04:01:38 2025 UTC