Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105771 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 13849 invoked from network); 21 May 2019 11:36:26 -0000 Received: from unknown (HELO mail-ua1-f53.google.com) (209.85.222.53) by pb1.pair.com with SMTP; 21 May 2019 11:36:26 -0000 Received: by mail-ua1-f53.google.com with SMTP id 49so6340759uas.0 for ; Tue, 21 May 2019 01:43:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mhkobXpYm4QQm+Gv+4p9JGWvJwHYe6UuDru16xlwjnQ=; b=GYmekDJowPekrFF8Ij5zbEv4PiVSnmu3XRNd0TY3+nmCsS8laKEAzwDGhZeq27sqsH X8QaGkEpnIZljMrcjlU/jr9eYt5j9ldLSJjrD6mnk+F+qYdOhqZBbg9w2QhE18DoZMaK PBsoR4LMg0bpdd+ntyK9/fYaXXReySFendvt1kpeAgsYI6lt9QyBAVyrm978GuU5I7mE 5ob0QYos9cHpSM/z/15Z0tgtXCf86R4k/Gn5gul+RWLLHCl9YxhlsmrK9Nl9WW1NDM8s tAe+esavw/pMhe4FfwlQKQ6pG4SqmR2mt1T4il5xzyuGbkmGeCNh5seBX4Wn4RQL8Vwl PHXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mhkobXpYm4QQm+Gv+4p9JGWvJwHYe6UuDru16xlwjnQ=; b=P04udd5CmiAdUFNcPoa21l6Z0hhTqK7N9vNlipu7y0ti4wLkXQlzGR3RtbXxh5AVwU LLtKjxlevq2LoAB2ZSDiSpjLTYWkrENn+zRN1XH2+CIzH0auF31Sp5LGGr6xu5JHhfXc dERLjOmKHOIgLZ0GTmQdSS2rJGw2TXhSTHxV1xyMZJCypg5UyC2zNcyyH7xFqgyJr75K VYwTdc0S04IEDQ8nfH/caTab4SjSKlpHTn/I0CEXVFe7Va6K+On11Nu8wLrtM/LBbZhO HXD6Nl06JiqybFyeXGAkZnxGHY3r+4iheN/WYI7k3X5zgNu5v5tQOLWXsuV60j6s1yBz iT9A== X-Gm-Message-State: APjAAAXXes8A+C0hHuuust0MvAdiTqIz10ojmS87sh/XJXDnkiIN+UGd rHYUgvoRWCPkACAjnu0dVjNYUdI8aun13wMSkOKDiA== X-Google-Smtp-Source: APXvYqw3D8ITC9haXQyQJ0rrDAqYCK1d8zE9V+JD926Bhoqn9Z7M+jhIZCXheuN3g1qF0itAKZkpzYFzlrTqGqDJres= X-Received: by 2002:ab0:7453:: with SMTP id p19mr18110579uaq.15.1558428227455; Tue, 21 May 2019 01:43:47 -0700 (PDT) MIME-Version: 1.0 References: <4bdc84d133912367ab9d5139f37f9a6e@exussum.co.uk> <2ba93b339e2291b2680186726e0e32ad@exussum.co.uk> In-Reply-To: <2ba93b339e2291b2680186726e0e32ad@exussum.co.uk> Date: Tue, 21 May 2019 09:43:34 +0100 Message-ID: To: Scott Dutton Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000e7d12a058961d80f" Subject: Re: [PHP-DEV] [RFC] Base convert changes From: george.banyard@gmail.com ("G. P. B.") --000000000000e7d12a058961d80f Content-Type: text/plain; charset="UTF-8" On Tue, 21 May 2019, 06:42 Scott Dutton, wrote: > > Not sure if I can add and example to the RFC at this point, but I came > across another example of this recently. > > > https://gist.github.com/iansltx/4820b02ab276c3306314daaa41573445#file-getlines-php-L9 > > // bindec() was doing weird things, hence converting through hex > first > // sttrev() to match endian-ness to expectations; zip file values > are little-endian > $compressedSize = hexdec(bin2hex(strrev(fread($stream, 4)))); // > compressed size > > bindec was returning 0 without warning, as it was passed binary data > not a binary string. No warning bin2hex actually does the correct > translation. > > a warning here would have at least indicated there was something wrong > with the input it was being passed instead of just 0. > > Thanks > > Scott > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php Until the RFC is in voting you can still make amendments to it. So feel free to add these functions/examples to the RFC. Best regards George Peter Banyard --000000000000e7d12a058961d80f--